Merge "Lessen the difference in appearance of title bar during load." into froyo
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 5e60b2d..41619df 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Prohlížeč"</string>
<string name="choose_upload" msgid="3649366287575002063">"Zvolit soubor, který chcete nahrát."</string>
<string name="new_tab" msgid="4505722538297295141">"Nové okno"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Platnost:"</string>
<string name="issued_on" msgid="2082890654801808368">"Datum vydání:"</string>
<string name="expires_on" msgid="8061200430557020704">"Platnost vyprší:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Zastavuji..."</string>
<string name="stop" msgid="5687251076030630074">"Zastavit"</string>
<string name="reload" msgid="8585220783228408062">"Obnovit"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Povolit JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Otevřít na pozadí"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Povolit pluginy"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Otevírat nová okna za aktuálním oknem"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Nastavit domovskou stránku"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Použít aktuální stránku"</string>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 26ff5a7..197c0de 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Browser"</string>
<string name="choose_upload" msgid="3649366287575002063">"Vælg fil til upload"</string>
<string name="new_tab" msgid="4505722538297295141">"Nyt vindue"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Gyldighed:"</string>
<string name="issued_on" msgid="2082890654801808368">"Udstedt den:"</string>
<string name="expires_on" msgid="8061200430557020704">"Udløber den:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Stopper ..."</string>
<string name="stop" msgid="5687251076030630074">"Stop"</string>
<string name="reload" msgid="8585220783228408062">"Opdater"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Aktiver Javascript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Åbn i baggrunden"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Aktiver plugins"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Åbn nye vinduer bag det aktive"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Angiv startside"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Brug aktuel side"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 98dd364..c61c70a 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Browser"</string>
<string name="choose_upload" msgid="3649366287575002063">"Datei zum Hochladen auswählen"</string>
<string name="new_tab" msgid="4505722538297295141">"Neues Fenster"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Gültigkeit:"</string>
<string name="issued_on" msgid="2082890654801808368">"Ausgegeben am:"</string>
<string name="expires_on" msgid="8061200430557020704">"Läuft ab am:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Wird angehalten..."</string>
<string name="stop" msgid="5687251076030630074">"Anhalten"</string>
<string name="reload" msgid="8585220783228408062">"Aktualisieren"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"JavaScript aktivieren"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Im Hintergrund öffnen"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Plug-ins aktivieren"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Neues Fenster hinter dem aktuellen Fenster öffnen"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Startseite festlegen"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Aktuelle Seite verwenden"</string>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index 29eea4e..098f2d8 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Internet"</string>
<string name="choose_upload" msgid="3649366287575002063">"Επιλογή αρχείου για μεταφόρτωση"</string>
<string name="new_tab" msgid="4505722538297295141">"Νέο παράθυρο"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Ισχύς:"</string>
<string name="issued_on" msgid="2082890654801808368">"Εκδόθηκε στις:"</string>
<string name="expires_on" msgid="8061200430557020704">"Λήγει:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Διακοπή..."</string>
<string name="stop" msgid="5687251076030630074">"Διακοπή"</string>
<string name="reload" msgid="8585220783228408062">"Ανανέωση"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Ενεργοποίηση JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Άνοιγμα στο παρασκήνιο"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Ενεργοποίηση πρόσθετων"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Άνοιγμα νέων παραθύρων πίσω από το τρέχον"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Ορισμός ως αρχική σελίδα"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Χρήση τρέχουσας σελίδας"</string>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 15c40d9..0f632f1 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Navegador"</string>
<string name="choose_upload" msgid="3649366287575002063">"Elegir el archivo para cargar"</string>
<string name="new_tab" msgid="4505722538297295141">"Ventana nueva"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Validez:"</string>
<string name="issued_on" msgid="2082890654801808368">"Enviado el:"</string>
<string name="expires_on" msgid="8061200430557020704">"Expira el:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Deteniendo..."</string>
<string name="stop" msgid="5687251076030630074">"Detener"</string>
<string name="reload" msgid="8585220783228408062">"Actualizar"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Habilitar JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Abrir en modo subord."</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Activar complementos"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Abrir ventanas nuevas detrás de la actual"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Definir página de inicio"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Utilizar la página actual"</string>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index ae7ea88..cd96e86 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Navegador"</string>
<string name="choose_upload" msgid="3649366287575002063">"Seleccionar archivo para subir"</string>
<string name="new_tab" msgid="4505722538297295141">"Nueva ventana"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Validez:"</string>
<string name="issued_on" msgid="2082890654801808368">"Fecha de emisión:"</string>
<string name="expires_on" msgid="8061200430557020704">"Fecha de caducidad:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Deteniendo..."</string>
<string name="stop" msgid="5687251076030630074">"Detener"</string>
<string name="reload" msgid="8585220783228408062">"Actualizar"</string>
@@ -120,7 +121,7 @@
<string name="clear" msgid="7070043081700011461">"Borrar"</string>
<string name="replace" msgid="4843033491070384047">"Sustituir"</string>
<string name="browser_bookmarks_page_bookmarks_text" msgid="6787605028726162673">"Marcadores"</string>
- <string name="menu_preferences" msgid="6709237687234102240">"Ajustes"</string>
+ <string name="menu_preferences" msgid="6709237687234102240">"Configuración"</string>
<string name="pref_content_title" msgid="722227111894838633">"Configuración de contenido de la página"</string>
<string name="pref_content_load_images" msgid="2125616852957377561">"Cargar imágenes"</string>
<string name="pref_content_load_images_summary" msgid="5055874125248398584">"Mostrar imágenes en páginas web"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Habilitar JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Abrir en segundo plano"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Habilitar complementos"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Abrir nuevas ventanas detrás de la actual"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Página de inicio"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Utilizar página actual"</string>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 55c83de..c80db78 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Navigateur"</string>
<string name="choose_upload" msgid="3649366287575002063">"Choisir le fichier à importer"</string>
<string name="new_tab" msgid="4505722538297295141">"Nouvelle fenêtre"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Validité :"</string>
<string name="issued_on" msgid="2082890654801808368">"Émis le :"</string>
<string name="expires_on" msgid="8061200430557020704">"Expire le :"</string>
-
<string name="stopping" msgid="4839698519340302982">"Arrêt..."</string>
<string name="stop" msgid="5687251076030630074">"Interrompre"</string>
<string name="reload" msgid="8585220783228408062">"Actualiser"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Activer JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Ouvrir en arrière-plan"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Activer les plug-ins"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Ouvrir les nouvelles fenêtres derrière la fenêtre actuelle"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Page d\'accueil"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Utiliser la page actuelle"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 18ee548..2cd29e1 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Browser"</string>
<string name="choose_upload" msgid="3649366287575002063">"Scegli il file per il caricamento"</string>
<string name="new_tab" msgid="4505722538297295141">"Nuova finestra"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Validità:"</string>
<string name="issued_on" msgid="2082890654801808368">"Rilasciato il:"</string>
<string name="expires_on" msgid="8061200430557020704">"Scade il:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Interruzione..."</string>
<string name="stop" msgid="5687251076030630074">"Interrompi"</string>
<string name="reload" msgid="8585220783228408062">"Aggiorna"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Attiva JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Apri in secondo piano"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Attiva plug-in"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Apri le nuove finestre dietro la finestra corrente"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Imposta home page"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Utilizza pagina corrente"</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 0f8a340..18f7103 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"ブラウザ"</string>
<string name="choose_upload" msgid="3649366287575002063">"アップロードするファイルを選択"</string>
<string name="new_tab" msgid="4505722538297295141">"新しいウィンドウ"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"有効期間:"</string>
<string name="issued_on" msgid="2082890654801808368">"発行:"</string>
<string name="expires_on" msgid="8061200430557020704">"有効期限:"</string>
-
<string name="stopping" msgid="4839698519340302982">"停止中..."</string>
<string name="stop" msgid="5687251076030630074">"停止"</string>
<string name="reload" msgid="8585220783228408062">"再読み込み"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"JavaScriptを有効にする"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"バックグラウンドで開く"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"プラグインを有効にする"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"現在のウィンドウの後ろに新しいウィンドウを開く"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"ホームページ設定"</string>
<string name="pref_use_current" msgid="1493179933653044553">"現在のページを使用"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 87ffbe8..47ab3cf 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"인터넷"</string>
<string name="choose_upload" msgid="3649366287575002063">"업로드할 파일 선택"</string>
<string name="new_tab" msgid="4505722538297295141">"새 창"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"유효성:"</string>
<string name="issued_on" msgid="2082890654801808368">"발급 날짜:"</string>
<string name="expires_on" msgid="8061200430557020704">"만료 날짜:"</string>
-
<string name="stopping" msgid="4839698519340302982">"중지하는 중..."</string>
<string name="stop" msgid="5687251076030630074">"중지"</string>
<string name="reload" msgid="8585220783228408062">"새로고침"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"자바스크립트 사용"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"백그라운드에서 열기"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"플러그인 사용"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"현재 창 뒤에 새 창 열기"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"홈페이지 설정"</string>
<string name="pref_use_current" msgid="1493179933653044553">"현재 페이지 사용"</string>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index da9945e..6600f0a 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Nettleser"</string>
<string name="choose_upload" msgid="3649366287575002063">"Velg fil for opplasting"</string>
<string name="new_tab" msgid="4505722538297295141">"Ny fane"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Gyldighet:"</string>
<string name="issued_on" msgid="2082890654801808368">"Utstedt:"</string>
<string name="expires_on" msgid="8061200430557020704">"Utløper den:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Avbryter…"</string>
<string name="stop" msgid="5687251076030630074">"Avbryt"</string>
<string name="reload" msgid="8585220783228408062">"Oppdater"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Aktiver JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Åpne i bakgrunnen"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Aktiver utvidelser"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Nye vinduer åpnes bak det gjeldende"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Angi startside"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Bruk nåværende side"</string>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index d28dbaf..72b6fe1 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Browser"</string>
<string name="choose_upload" msgid="3649366287575002063">"Bestand selecteren voor uploaden"</string>
<string name="new_tab" msgid="4505722538297295141">"Nieuw venster"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Geldigheid:"</string>
<string name="issued_on" msgid="2082890654801808368">"Uitgegeven op:"</string>
<string name="expires_on" msgid="8061200430557020704">"Verloopt op:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Stoppen..."</string>
<string name="stop" msgid="5687251076030630074">"Stoppen"</string>
<string name="reload" msgid="8585220783228408062">"Vernieuwen"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"JavaScript inschakelen"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Openen op de achtergrond"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Invoegtoepassingen inschakelen"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Nieuwe vensters openen achter het huidige venster"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Startpagina instellen"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Huidige pagina gebruiken"</string>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 22c6c2a..3406861 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Internet"</string>
<string name="choose_upload" msgid="3649366287575002063">"Wybierz plik do przesłania"</string>
<string name="new_tab" msgid="4505722538297295141">"Nowe okno"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Poprawność:"</string>
<string name="issued_on" msgid="2082890654801808368">"Data wystawienia:"</string>
<string name="expires_on" msgid="8061200430557020704">"Wygasa:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Trwa zatrzymywanie…"</string>
<string name="stop" msgid="5687251076030630074">"Zatrzymaj"</string>
<string name="reload" msgid="8585220783228408062">"Odśwież"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Włącz skrypty JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Otwórz w tle"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Włącz wtyczki"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Otwieraj nowe okna za bieżącym"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Ustaw stronę główną"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Użyj bieżącej strony"</string>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index d4e3527..1f7510c 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Browser"</string>
<string name="choose_upload" msgid="3649366287575002063">"Escolher ficheiro a carregar"</string>
<string name="new_tab" msgid="4505722538297295141">"Nova janela"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Validade:"</string>
<string name="issued_on" msgid="2082890654801808368">"Emitido em:"</string>
<string name="expires_on" msgid="8061200430557020704">"Expira em:"</string>
-
<string name="stopping" msgid="4839698519340302982">"A interromper..."</string>
<string name="stop" msgid="5687251076030630074">"Parar"</string>
<string name="reload" msgid="8585220783228408062">"Actualizar"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Activar JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Abrir em segundo plano"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Activar plug-ins"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Abrir novas janelas atrás da actual"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Definir página inicial"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Utilizar página actual"</string>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index cbeab9a..f62b502 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Navegador"</string>
<string name="choose_upload" msgid="3649366287575002063">"Escolha o arquivo para envio"</string>
<string name="new_tab" msgid="4505722538297295141">"Nova janela"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Validade:"</string>
<string name="issued_on" msgid="2082890654801808368">"Emitido em:"</string>
<string name="expires_on" msgid="8061200430557020704">"Expira em:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Parando…"</string>
<string name="stop" msgid="5687251076030630074">"Parar"</string>
<string name="reload" msgid="8585220783228408062">"Atualizar"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Ativar JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Abrir em segundo plano"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Ativar plug-ins"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Abrir novas janelas atrás da janela atual"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Definir a página inicial"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Usar a página atual"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 096d5a5..8686f9c 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Браузер"</string>
<string name="choose_upload" msgid="3649366287575002063">"Выберите файл для загрузки"</string>
<string name="new_tab" msgid="4505722538297295141">"Новое окно"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Срок действия:"</string>
<string name="issued_on" msgid="2082890654801808368">"Дата издания:"</string>
<string name="expires_on" msgid="8061200430557020704">"Дата окончания действия:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Остановка..."</string>
<string name="stop" msgid="5687251076030630074">"Стоп"</string>
<string name="reload" msgid="8585220783228408062">"Обновить"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Включить JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Открывать в фоновом режиме"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Включить плагины"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Открывать новые окна позади текущего окна"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Выбрать главную страницу"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Использовать текущую страницу"</string>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index 52cdf42..917ed67 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Webbläs."</string>
<string name="choose_upload" msgid="3649366287575002063">"Välj filen som du vill överföra"</string>
<string name="new_tab" msgid="4505722538297295141">"Nytt fönster"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Giltighet:"</string>
<string name="issued_on" msgid="2082890654801808368">"Utfärdat den:"</string>
<string name="expires_on" msgid="8061200430557020704">"Upphör att gälla:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Avbryter…"</string>
<string name="stop" msgid="5687251076030630074">"Stoppa"</string>
<string name="reload" msgid="8585220783228408062">"Uppdatera"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"Aktivera JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Öppen i bakgrunden"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Aktivera plugin-program"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Öppna nya fönster bakom det aktiva"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Ange startsida"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Använd aktuell sida"</string>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index d0c1fca..e526f80 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"Tarayıcı"</string>
<string name="choose_upload" msgid="3649366287575002063">"Yükleme için dosya seçin"</string>
<string name="new_tab" msgid="4505722538297295141">"Yeni pencere"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"Geçerlilik:"</string>
<string name="issued_on" msgid="2082890654801808368">"Yayınlanma tarihi:"</string>
<string name="expires_on" msgid="8061200430557020704">"Sona erme tarihi:"</string>
-
<string name="stopping" msgid="4839698519340302982">"Durduruluyor..."</string>
<string name="stop" msgid="5687251076030630074">"Durdur"</string>
<string name="reload" msgid="8585220783228408062">"Yenile"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"JavaScript\'i etkinleştir"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"Arka planda aç"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"Eklentileri etkinleştir"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"Geçerli pencerenin arkasında yeni pencereler aç"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"Ana sayfayı ayarla"</string>
<string name="pref_use_current" msgid="1493179933653044553">"Geçerli sayfayı kullan"</string>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 77415dc..4821fff 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"浏览器"</string>
<string name="choose_upload" msgid="3649366287575002063">"选择要上传的文件"</string>
<string name="new_tab" msgid="4505722538297295141">"新窗口"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"有效期:"</string>
<string name="issued_on" msgid="2082890654801808368">"颁发时间:"</string>
<string name="expires_on" msgid="8061200430557020704">"有效期至:"</string>
-
<string name="stopping" msgid="4839698519340302982">"正在停止..."</string>
<string name="stop" msgid="5687251076030630074">"停止"</string>
<string name="reload" msgid="8585220783228408062">"刷新"</string>
@@ -99,7 +100,7 @@
<string name="bookmarks" msgid="1961279134885867815">"书签"</string>
<string name="shortcut_bookmark" msgid="3974876480401135895">"书签"</string>
<string name="history" msgid="2451240511251410032">"历史记录"</string>
- <string name="menu_view_download" msgid="2124570321712995120">"下载"</string>
+ <string name="menu_view_download" msgid="2124570321712995120">"下载内容"</string>
<string name="copy_page_url" msgid="7635062169011319208">"复制网页网址"</string>
<string name="share_page" msgid="593756995297268343">"分享网页"</string>
<string name="contextmenu_openlink" msgid="7237961252214188935">"打开"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"启用 JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"在后方打开"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"启用插件"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"在当前窗口后方打开新窗口"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"设置主页"</string>
<string name="pref_use_current" msgid="1493179933653044553">"使用当前页面"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 2b86da3..4efbf5d 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="1935869255545976415">"瀏覽器"</string>
<string name="choose_upload" msgid="3649366287575002063">"選擇要上載的檔案"</string>
<string name="new_tab" msgid="4505722538297295141">"新視窗"</string>
@@ -58,7 +60,6 @@
<string name="validity_period" msgid="57988851973181309">"合法性:"</string>
<string name="issued_on" msgid="2082890654801808368">"發給:"</string>
<string name="expires_on" msgid="8061200430557020704">"有效日期:"</string>
-
<string name="stopping" msgid="4839698519340302982">"停止中…"</string>
<string name="stop" msgid="5687251076030630074">"停止"</string>
<string name="reload" msgid="8585220783228408062">"重新整理"</string>
@@ -128,6 +129,9 @@
<string name="pref_content_javascript" msgid="4570972030299516843">"啟用 JavaScript"</string>
<string name="pref_content_open_in_background" msgid="824123779725118663">"在背景中開啟"</string>
<string name="pref_content_plugins" msgid="7231944644794301582">"啟用外掛程式"</string>
+ <!-- no translation found for pref_content_plugins_choices:0 (6745108155096660725) -->
+ <!-- no translation found for pref_content_plugins_choices:1 (2484126708670016519) -->
+ <!-- no translation found for pref_content_plugins_choices:2 (8547442717307793863) -->
<string name="pref_content_open_in_background_summary" msgid="1737664075721181678">"在目前視窗的後面開啟新視窗"</string>
<string name="pref_content_homepage" msgid="6082437160778559806">"設定首頁"</string>
<string name="pref_use_current" msgid="1493179933653044553">"使用目前的網頁"</string>
@@ -226,7 +230,7 @@
<string name="too_many_subwindows_dialog_title" msgid="3805453941587725944">"已開啟快顯視窗"</string>
<string name="too_many_subwindows_dialog_message" msgid="5827289829907966657">"無法開啟新的快顯視窗,同時只能有一個快顯視窗存在。"</string>
<string name="download_title" msgid="2122874021047565594">"下載記錄"</string>
- <string name="download_unknown_filename" msgid="4013465542563652175">"<未知>"</string>
+ <string name="download_unknown_filename" msgid="4013465542563652175">"<不明>"</string>
<string name="download_menu_open" msgid="4888327480367757513">"開啟"</string>
<string name="download_menu_clear" msgid="6264454531553418124">"清除表單列表"</string>
<string name="download_menu_delete" msgid="8815502136393894148">"刪除"</string>
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 8a61c3e..c51c52b 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -820,15 +820,14 @@
}
private void showFakeTitleBar() {
- final View decor = getWindow().peekDecorView();
if (mFakeTitleBar.getParent() == null && mActiveTabsPage == null
- && !mActivityInPause && decor != null
- && decor.getWindowToken() != null) {
- Rect visRect = new Rect();
- if (!mBrowserFrameLayout.getGlobalVisibleRect(visRect)) {
- if (LOGD_ENABLED) {
- Log.d(LOGTAG, "showFakeTitleBar visRect failed");
- }
+ && !mActivityInPause) {
+ WebView mainView = mTabControl.getCurrentWebView();
+ // if there is no current WebView, don't show the faked title bar;
+ // if the main WebView's contentHeight is 0, it means the WebView
+ // hasn't finished the start up process yet. Don't try to show this
+ // window which will slow down the starting process.
+ if (mainView == null || mainView.getContentHeight() == 0) {
return;
}
@@ -841,17 +840,12 @@
= new WindowManager.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
- WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL,
+ WindowManager.LayoutParams.TYPE_APPLICATION,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
params.gravity = Gravity.TOP;
- WebView mainView = mTabControl.getCurrentWebView();
- boolean atTop = mainView != null && mainView.getScrollY() == 0;
+ boolean atTop = mainView.getScrollY() == 0;
params.windowAnimations = atTop ? 0 : R.style.TitleBar;
- // XXX : Without providing an offset, the fake title bar will be
- // placed underneath the status bar. Use the global visible rect
- // of mBrowserFrameLayout to determine the bottom of the status bar
- params.y = visRect.top;
manager.addView(mFakeTitleBar, params);
}
}
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java
index 1c58beb..7dd85aa 100644
--- a/src/com/android/browser/BrowserBookmarksPage.java
+++ b/src/com/android/browser/BrowserBookmarksPage.java
@@ -72,6 +72,7 @@
private boolean mCreateShortcut;
private boolean mMostVisited;
private View mEmptyView;
+ private int mIconSize;
// XXX: There is no public string defining this intent so if Home changes
// the value, we have to update this string.
private static final String INSTALL_SHORTCUT =
@@ -230,6 +231,10 @@
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
+ // Grab the app icon size as a resource.
+ mIconSize = getResources().getDimensionPixelSize(
+ android.R.dimen.app_icon_size);
+
if (Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) {
mCreateShortcut = true;
}
@@ -441,26 +446,34 @@
i.putExtra(Intent.EXTRA_SHORTCUT_NAME, title);
// Use the apple-touch-icon if available
if (touchIcon != null) {
- // Make a copy so we can modify the pixels.
- Bitmap copy = touchIcon.copy(Bitmap.Config.ARGB_8888, true);
- Canvas canvas = new Canvas(copy);
+ // Make a copy so we can modify the pixels. We can't use
+ // createScaledBitmap or copy since they will preserve the config
+ // and lose the ability to add alpha.
+ Bitmap bm = Bitmap.createBitmap(mIconSize, mIconSize,
+ Bitmap.Config.ARGB_8888);
+ Canvas canvas = new Canvas(bm);
+ Rect src = new Rect(0, 0, touchIcon.getWidth(),
+ touchIcon.getHeight());
+ Rect dest = new Rect(0, 0, bm.getWidth(), bm.getHeight());
+
+ // Paint used for scaling the bitmap and drawing the rounded rect.
+ Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ paint.setFilterBitmap(true);
+ canvas.drawBitmap(touchIcon, src, dest, paint);
// Construct a path from a round rect. This will allow drawing with
// an inverse fill so we can punch a hole using the round rect.
Path path = new Path();
path.setFillType(Path.FillType.INVERSE_WINDING);
- RectF rect = new RectF(0, 0, touchIcon.getWidth(),
- touchIcon.getHeight());
+ RectF rect = new RectF(0, 0, bm.getWidth(), bm.getHeight());
rect.inset(1, 1);
path.addRoundRect(rect, 8f, 8f, Path.Direction.CW);
- // Construct a paint that clears the outside of the rectangle and
- // draw.
- Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ // Reuse the paint and clear the outside of the rectangle.
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
canvas.drawPath(path, paint);
- i.putExtra(Intent.EXTRA_SHORTCUT_ICON, copy);
+ i.putExtra(Intent.EXTRA_SHORTCUT_ICON, bm);
} else {
Bitmap favicon = getFavicon(position);
if (favicon == null) {
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 07b17a9..8c2371a 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1506,8 +1506,30 @@
// container to the content view.
FrameLayout wrapper =
(FrameLayout) mContainer.findViewById(R.id.webview_wrapper);
- wrapper.addView(mMainView);
- content.addView(mContainer, BrowserActivity.COVER_SCREEN_PARAMS);
+ ViewGroup parent = (ViewGroup) mMainView.getParent();
+ if (parent != wrapper) {
+ if (parent != null) {
+ Log.w(LOGTAG, "mMainView already has a parent in"
+ + " attachTabToContentView!");
+ parent.removeView(mMainView);
+ }
+ wrapper.addView(mMainView);
+ } else {
+ Log.w(LOGTAG, "mMainView is already attached to wrapper in"
+ + " attachTabToContentView!");
+ }
+ parent = (ViewGroup) mContainer.getParent();
+ if (parent != content) {
+ if (parent != null) {
+ Log.w(LOGTAG, "mContainer already has a parent in"
+ + " attachTabToContentView!");
+ parent.removeView(mContainer);
+ }
+ content.addView(mContainer, BrowserActivity.COVER_SCREEN_PARAMS);
+ } else {
+ Log.w(LOGTAG, "mContainer is already attached to content in"
+ + " attachTabToContentView!");
+ }
attachSubWindow(content);
}
diff --git a/tests/assets/bindings_test.html b/tests/assets/bindings_test.html
new file mode 100755
index 0000000..93dbff1
--- /dev/null
+++ b/tests/assets/bindings_test.html
@@ -0,0 +1,231 @@
+<html>
+<head>
+<script type="text/javascript">
+
+function testPrimitiveTypes() {
+ return JNIBindingsTest.testPrimitiveTypes(100, 'c', 123.34567890, 456.789, 1234567, 1234567890, 6000, true);
+}
+
+function testObjectTypes() {
+ return JNIBindingsTest.testObjectTypes("Foo", "", {"foo":"bar"}, {});
+}
+
+function testArray() {
+ return JNIBindingsTest.testArray([1,2,3], ['d', 'o', 'g'], [1.2, 2.3, 3.4], [4.5,5.6,6.7], [1,2,3], [4,5,6], [7,8,9], [true, false]);
+}
+
+function testObjectArray() {
+ return JNIBindingsTest.testObjectArray(['Hello', 'World', '!'], [], [{"foo":"bar"}]);
+}
+
+function testObjectMembers() {
+ var foo = {"bool":true,
+ "byte":101,
+ "char":'d',
+ "double":123.456,
+ "float":456.789,
+ "int":102,
+ "long":103,
+ "short":104,
+ "string":"Hello World",
+ "array": [1,2,3],
+ "objArray":["foo", "bar", "baz"],
+ "object": {"foo":1}
+ };
+ return JNIBindingsTest.testObjectMembers(foo.bool, foo.byte, foo.char, foo.double, foo.float, foo.int, foo.long, foo.short, foo.string, foo.array, foo.objArray, foo.object);
+}
+
+function testJSPrimitivesToStringsInJava() {
+ return JNIBindingsTest.testJSPrimitivesToStringsInJava(123, null, 456.789, true, 'd', undefined);
+}
+
+function testJavaReturnTypes() {
+ var expectedBoolReturn = true;
+ var expectedByteReturn = 1;
+ var expectedCharReturn = 98; // 'b'; Currently bindings in JSC and V8 return chars as their ASCII equivalent.
+ var expectedDoubleReturn = 123.456;
+ var expectedFloatReturn = 456.789;
+ var expectedIntReturn = 123;
+ var expectedLongReturn = 1234;
+ var expectedShortReturn = 12345;
+ var expectedStringReturn = "Hello World!";
+
+ var returned = JNIBindingsTest.returnBool();
+ if (returned != expectedBoolReturn) {
+ appendLog("returnBool() failed: expected "+ expectedBoolReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnByte();
+ if (returned != expectedByteReturn) {
+ appendLog("returnByte() failed: expected "+ expectedByteReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnChar();
+ if (returned != expectedCharReturn) {
+ appendLog("returnChar() failed: expected "+ expectedCharReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnDouble();
+ if (returned != expectedDoubleReturn) {
+ appendLog("returnDouble() failed: expected "+ expectedDoubleReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnFloat();
+ if (Math.abs(returned - expectedFloatReturn) > 0.001) {
+ appendLog("returnFloat() failed: expected "+ expectedFloatReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnInt();
+ if (returned != expectedIntReturn) {
+ appendLog("returnInt() failed: expected "+ expectedIntReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnLong();
+ if (returned != expectedLongReturn) {
+ appendLog("returnLong() failed: expected "+ expectedLongReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnShort();
+ if (returned != expectedShortReturn) {
+ appendLog("returnShort() failed: expected "+ expectedShortReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnString();
+ if (returned != expectedStringReturn) {
+ appendLog("returnString() failed: expected "+ expectedStringReturn +", got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnObject();
+ if (returned == null) {
+ appendLog("returnObject() failed: expected non-null, got " + returned);
+ return false;
+ } else if (returned.x != 0) {
+ // EMULATE_JSC_BINDINGS
+ // Note: the Java sets the x property to 123. JSC and V8 do not support object
+ // members in the bindings though.
+ appendLog("returnObject() failed: expected 'x' property 0, got " + returned.x)
+ return false;
+ } else if (returned.s != undefined) {
+ // EMULATE_JSC_BINDINGS
+ // Note that the java class returned has s set to Hello World. JSC and V8 do not support
+ // getting properties.
+ appendLog("returnObject() failed: expected 's' property undefined, got " + returned.s);
+ return false;
+ } else if (!returned.aMethod()) {
+ appendLog("returnObject() failed: expected 'aMethod' method to return true, got " + returned.aMethod());
+ return false;
+ } else if (returned.anotherMethod() != "Hello World") {
+ appendLog("returnObject() failed: expected 'anotherMethod' to return 'Hello World' got "+ returned.anotherMethod());
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnArray();
+ if (returned != null) {
+ appendLog("returnArray() failed: expected null, got " + returned);
+ return false;
+ }
+
+ returned = JNIBindingsTest.returnVoid();
+ if (returned != null) {
+ appendLog("returnVoid() failed: expected null, got " + returned);
+ return false;
+ }
+
+ return true;
+}
+
+function getIfaceProperties() {
+ if (JNIBindingsTest.mInt != 0) {
+ // EMULATE_JSC_BINDINGS
+ // Note: the Java sets the mInt property to 123. JSC and V8 do not support object
+ // members in the bindings though.
+ appendLog("getIfaceProperties() failed: expected mInt = 0, got " + JNIBindingsTest.mInt);
+ return false;
+ }
+
+ if (JNIBindingsTest.mString != undefined) {
+ // EMULATE_JSC_BINDINGS
+ // Note that the java class returned has s set to Hello World. JSC and V8 do not support
+ // getting properties.
+ appendLog("getIfaceProperties() failed: expected mString = 'Hello World', got " + JNIBindingsTest.mString);
+ return false;
+ }
+
+ return true;
+}
+
+function appendLog(msg) {
+ var log = document.getElementById("status");
+ log.innerHTML += "<br/>" + msg;
+}
+
+function runTests() {
+
+ // Assume that if the test isn't done after 10s that we failed.
+ window.setTimeout(function() { JNIBindingsTest.testComplete(); }, 10000);
+
+ if (testPrimitiveTypes()) {
+ appendLog("testPrimitiveTypes passed!");
+ } else {
+ appendLog("testPrimtiveTypes failed!");
+ }
+
+ if (testObjectTypes()) {
+ appendLog("testObjectTypes passed!");
+ } else {
+ appendLog("testObjectTypes failed!");
+ }
+
+ if (testArray()) {
+ appendLog("testArray passed!");
+ } else {
+ appendLog("testArray failed!");
+ }
+
+ if (testObjectArray()) {
+ appendLog("testObjectArray passed!");
+ } else {
+ appendLog("testObjectArray failed!");
+ }
+
+ if (testObjectMembers()) {
+ appendLog("testObjectMembers passed!");
+ } else {
+ appendLog("<br/>testObjectMembers failed!");
+ }
+
+ if (testJSPrimitivesToStringsInJava()) {
+ appendLog("testJSPrimitivesToStringsInJava passed!");
+ } else {
+ appendLog("testJSPrimitivesToStringsInJava failed!");
+ }
+
+ if (testJavaReturnTypes()) {
+ appendLog("testJavaReturnTypes passed!");
+ } else {
+ appendLog("testJavaReturnTypes failed!");
+ }
+
+ if (getIfaceProperties()) {
+ appendLog("getIfaceProperties passed!");
+ } else {
+ appendLog("getIfaceProperties failed!");
+ }
+
+ JNIBindingsTest.testComplete();
+}
+</script>
+
+<body onload="runTests();">
+<p id="status">Running JNI Bindings test...</p>
+</body>
+</html>
diff --git a/tests/src/com/android/browser/JNIBindingsTest.java b/tests/src/com/android/browser/JNIBindingsTest.java
new file mode 100644
index 0000000..d2220f6
--- /dev/null
+++ b/tests/src/com/android/browser/JNIBindingsTest.java
@@ -0,0 +1,267 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.browser;
+
+import android.test.AndroidTestCase;
+import android.util.Log;
+
+import java.util.Arrays;
+import junit.framework.AssertionFailedError;
+
+public class JNIBindingsTest extends AndroidTestCase {
+
+ private final static String LOGTAG = "JNIBindingsTest";
+ private JNIBindingsTestApp mTestApp;
+
+ public int mInt = 123;
+ public String mString = "Hello World";
+
+ public JNIBindingsTest(JNIBindingsTestApp testApp) {
+ mTestApp = testApp;
+ }
+
+ public void testComplete() {
+ Log.v(LOGTAG, "Completing the test.");
+ mTestApp.testComplete();
+ }
+
+ public void printAssertionFailed(AssertionFailedError e) {
+ Log.e(LOGTAG, "");
+ Log.e(LOGTAG, "*** ASSERTION FAILED: " + e.getMessage());
+ Log.e(LOGTAG, "*** Stack trace:");
+ StackTraceElement[] trace = e.getStackTrace();
+ for(StackTraceElement elem : trace) {
+ Log.e(LOGTAG, "***\t" + elem.toString());
+ }
+ Log.e(LOGTAG, "");
+ }
+
+ public boolean testPrimitiveTypes(byte byteParam, char charParam, double doubleParam,
+ float floatParam, int intParam, long longParam, short shortParam,
+ boolean booleanParam) {
+ byte expectedByteParam = 100;
+ char expectedCharParam = 'c';
+ double expectedDoubleParam = 123.34567890;
+ float expectedFloatParam = 456.789f;
+ int expectedIntParam = 1234567;
+ long expectedLongParam = 1234567890L;
+ short expectedShortParam = 6000;
+ boolean expectedBooleanParam = true;
+
+ try {
+ assertEquals(expectedByteParam, byteParam);
+
+ // EMULATE_JSC_BINDINGS: JSC does not pass chars correctly
+ // assertEquals(expectedCharParam, charParam);
+
+ assertEquals(expectedDoubleParam, doubleParam);
+ assertEquals(expectedFloatParam, floatParam);
+ assertEquals(expectedIntParam, intParam);
+ assertEquals(expectedLongParam, longParam);
+ assertEquals(expectedShortParam, shortParam);
+ assertEquals(expectedBooleanParam, booleanParam);
+ } catch (AssertionFailedError e) {
+ printAssertionFailed(e);
+ return false;
+ }
+ return true;
+ }
+
+ public boolean testObjectTypes(String stringParam, String emptyString, Object objectParam,
+ Object emptyObject) {
+ String expectedString = "Foo";
+ String expectedEmptyString = "";
+
+ try {
+ assertNotNull(stringParam);
+ assertNotNull(emptyString);
+ assertEquals(expectedString, stringParam);
+ assertEquals(expectedEmptyString, emptyString);
+ assertNull(objectParam);
+ assertNull(emptyObject);
+ } catch (AssertionFailedError e) {
+ printAssertionFailed(e);
+ return false;
+ }
+ return true;
+ }
+
+ public boolean testArray(byte[] byteArray, char[] charArray, double[] doubleArray,
+ float[] floatArray, int[] intArray, long[] longArray, short[] shortArray,
+ boolean[] booleanArray) {
+ byte[] expectedByteArray = { 1,2,3};
+ char[] expectedCharArray = {'d', 'o', 'g'};
+ double[] expectedDoubleArray = {1.2,2.3,3.4};
+ float[] expectedFloatArray = {4.5F,5.6F,6.7F};
+ int[] expectedIntArray = {1,2,3};
+ long[] expectedLongArray = {4L,5L,6L};
+ short[] expectedShortArray = {7,8,9};
+ boolean[] expectedBooleanArray = {true, false};
+
+ try {
+ assertNotNull(byteArray);
+ assertNotNull(charArray);
+ assertNotNull(doubleArray);
+ assertNotNull(floatArray);
+ assertNotNull(intArray);
+ assertNotNull(longArray);
+ assertNotNull(shortArray);
+ assertNotNull(booleanArray);
+ assertEquals(Arrays.toString(expectedByteArray), Arrays.toString(byteArray));
+ assertEquals(Arrays.toString(expectedCharArray), Arrays.toString(charArray));
+ assertEquals(Arrays.toString(expectedDoubleArray), Arrays.toString(doubleArray));
+ assertEquals(Arrays.toString(expectedFloatArray), Arrays.toString(floatArray));
+ assertEquals(Arrays.toString(expectedIntArray), Arrays.toString(intArray));
+ assertEquals(Arrays.toString(expectedLongArray), Arrays.toString(longArray));
+ assertEquals(Arrays.toString(expectedShortArray), Arrays.toString(shortArray));
+ assertEquals(Arrays.toString(expectedBooleanArray), Arrays.toString(booleanArray));
+ } catch (AssertionFailedError e) {
+ printAssertionFailed(e);
+ return false;
+ }
+ return true;
+ }
+
+ public boolean testObjectArray(String[] stringArray, Object[] emptyArray,
+ Object[] objectArray) {
+ String[] expectedStringArray = {"Hello", "World", "!"};
+ Object[] expectedObjectArray = {};
+
+ try {
+ assertNotNull(stringArray);
+
+ // EMULATE_JSC_BINDINGS JSC pass null for object arrays that are not strings.
+ // Should be an empty array?
+ assertNull(emptyArray);
+ assertNull(objectArray);
+
+ assertEquals(Arrays.toString(expectedStringArray), Arrays.toString(stringArray));
+
+ // EMULATE_JSC_BINDINGS
+ // assertEquals(Arrays.toString(expectedObjectArray), Arrays.toString(emptyArray));
+ // assertEquals(Arrays.toString(expectedObjectArray), Arrays.toString(objectArray));
+
+ } catch (AssertionFailedError e) {
+ printAssertionFailed(e);
+ return false;
+ }
+ return true;
+ }
+
+ public boolean testObjectMembers(boolean boolParam, byte byteParam, char charParam,
+ double doubleParam, float floatParam, int intParam, long longParam, short shortParam,
+ String stringParam, int[] intArrayParam, String[] stringArrayParam,
+ Object objectParam) {
+ boolean expectedBoolParam = true;
+ byte expectedByteParam = 101;
+ char expectedCharParam = 'd';
+ double expectedDoubleParam = 123.456;
+ float expectedFloatParam = 456.789F;
+ int expectedIntParam = 102;
+ long expectedLongParam = 103L;
+ short expectedShortParam = 104;
+ String expectedStringParam = "Hello World";
+ int[] expectedIntArray = {1,2,3};
+ String[] expectedStringArrayParam = {"foo", "bar", "baz"};
+
+ try {
+ assertEquals(expectedBoolParam, boolParam);
+ assertEquals(expectedByteParam, byteParam);
+
+ // EMULATE_JSC_BINDINGS: JSC does not pass chars correctly. (chars are strings in JS)
+ // assertEquals(expectedCharParam, charParam);
+
+ assertEquals(expectedDoubleParam, doubleParam);
+ assertEquals(expectedFloatParam, floatParam);
+ assertEquals(expectedIntParam, intParam);
+ assertEquals(expectedLongParam, longParam);
+ assertEquals(expectedShortParam, shortParam);
+ assertEquals(expectedStringParam, stringParam);
+ assertEquals(Arrays.toString(expectedIntArray), Arrays.toString(intArrayParam));
+ assertEquals(Arrays.toString(expectedStringArrayParam),
+ Arrays.toString(stringArrayParam));
+ assertNull(objectParam);
+ } catch (AssertionFailedError e) {
+ printAssertionFailed(e);
+ return false;
+ }
+ return true;
+ }
+
+ public boolean testJSPrimitivesToStringsInJava(String intParam, String nullParam,
+ String doubleParam, String booleanParam, String charParam,
+ String undefinedParam) {
+ String expectedIntParam = "123";
+ String expectedDoubleParam = "456.789";
+ String expectedBooleanParam = "true";
+ String expectedCharParam = "d";
+
+ // EMULATE_JSC_BINDINGS JSC passes "undefined" for undefined types. Should be null?
+ String expectedUndefinedParam = "undefined";
+
+ try {
+ assertNotNull(intParam);
+ assertNull(nullParam);
+ assertNotNull(doubleParam);
+ assertNotNull(booleanParam);
+ assertNotNull(charParam);
+
+ // EMULATE_JSC_BINDINGS JSC passes "undefined" for undefined types.
+ assertNotNull(undefinedParam);
+
+ assertEquals(expectedIntParam, intParam);
+ assertEquals(expectedDoubleParam, doubleParam);
+ assertEquals(expectedBooleanParam, booleanParam);
+ assertEquals(expectedCharParam, charParam);;
+
+ // EMULATE_JSC_BINDINGS JSC passes "undefined" for undefined types.
+ assertEquals(expectedUndefinedParam, undefinedParam);
+
+ } catch (AssertionFailedError e) {
+ printAssertionFailed(e);
+ return false;
+ }
+ return true;
+ }
+
+ public boolean returnBool() { return true; }
+ public byte returnByte() { return 1; }
+ public char returnChar() { return 'b'; }
+ public double returnDouble() { return 123.456; }
+ public float returnFloat() { return 456.789F; }
+ public int returnInt() { return 123; }
+ public long returnLong() { return 1234L; }
+ public short returnShort() { return 12345; }
+ public String returnString() { return "Hello World!"; }
+
+ public class TestObject {
+ public int x = 123;
+ public String s = "Hello World!";
+
+ public boolean aMethod() { return true; }
+ public String anotherMethod() { return "Hello World"; }
+ }
+
+ public TestObject returnObject() { return new TestObject(); }
+
+ public int[] returnArray() {
+ int[] array = {1,2,3,4,5};
+ return array;
+ }
+
+ public void returnVoid() { }
+}
diff --git a/tests/src/com/android/browser/JNIBindingsTestApp.java b/tests/src/com/android/browser/JNIBindingsTestApp.java
new file mode 100644
index 0000000..cb38cbc
--- /dev/null
+++ b/tests/src/com/android/browser/JNIBindingsTestApp.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.browser;
+
+import android.app.Instrumentation;
+import android.net.http.SslError;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.test.ActivityInstrumentationTestCase2;
+import android.util.Log;
+import android.webkit.JsPromptResult;
+import android.webkit.JsResult;
+import android.webkit.SslErrorHandler;
+import android.webkit.WebView;
+
+/**
+ * Adds a JavaScript interface to the webview and calls functions on it to verify variables
+ * are passed from JS to Java correctly.
+ */
+public class JNIBindingsTestApp extends ActivityInstrumentationTestCase2<BrowserActivity> {
+
+ private final static String TAG = "JNIBindingsTest";
+
+ private static final int MSG_WEBKIT_DATA_READY = 101;
+
+ private BrowserActivity mActivity = null;
+ private Instrumentation mInst = null;
+
+ private boolean mTestDone = false;
+ private String mWebKitResult;
+
+ private String mExpectedWebKitResult = "Running JNI Bindings test...\n" +
+ "testPrimitiveTypes passed!\n" +
+ "testObjectTypes passed!\n" +
+ "testArray passed!\n" +
+ "testObjectArray passed!\n" +
+ "testObjectMembers passed!\n" +
+ "testJSPrimitivesToStringsInJava passed!\n" +
+ "testJavaReturnTypes passed!\n" +
+ "getIfaceProperties passed!\n";
+
+
+ private class GetWebKitDataThread extends Thread {
+ private JNIBindingsTestApp mTestApp;
+ private WebView mWebView;
+ private Handler mHandler;
+
+ GetWebKitDataThread(JNIBindingsTestApp testApp, WebView webView) {
+ mTestApp = testApp;
+ mWebView = webView;
+ }
+
+ public void run() {
+ Looper.prepare();
+ mHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_WEBKIT_DATA_READY: {
+ mTestApp.setWebKitResult((String)msg.obj);
+ Looper.myLooper().quit();
+ }
+ default: super.handleMessage(msg); break;
+ }
+ }
+ };
+ mWebView.documentAsText(mHandler.obtainMessage(MSG_WEBKIT_DATA_READY));
+ Looper.loop();
+ }
+ }
+
+ public synchronized void setWebKitResult(String result) {
+ mWebKitResult = result;
+ notify();
+ }
+
+ public JNIBindingsTestApp() {
+ super(BrowserActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ mActivity = getActivity();
+ mInst = getInstrumentation();
+ mInst.waitForIdleSync();
+
+ }
+
+ /**
+ * Gets the browser ready for testing by starting the application
+ * and wrapping the WebView's helper clients.
+ */
+ void setUpBrowser() {
+ Tab tab = mActivity.getTabControl().getCurrentTab();
+ WebView webView = tab.getWebView();
+ webView.addJavascriptInterface(new JNIBindingsTest(this), "JNIBindingsTest");
+
+ webView.setWebChromeClient(new TestWebChromeClient(webView.getWebChromeClient()) {
+
+ /**
+ * Dismisses and logs Javascript alerts.
+ */
+ @Override
+ public boolean onJsAlert(WebView view, String url, String message,
+ JsResult result) {
+ String logMsg = String.format("JS Alert '%s' received from %s", message, url);
+ Log.w(TAG, logMsg);
+ result.confirm();
+
+ return true;
+ }
+
+ /**
+ * Confirms and logs Javascript alerts.
+ */
+ @Override
+ public boolean onJsConfirm(WebView view, String url, String message,
+ JsResult result) {
+ String logMsg = String.format("JS Confirmation '%s' received from %s",
+ message, url);
+ Log.w(TAG, logMsg);
+ result.confirm();
+
+ return true;
+ }
+
+ /**
+ * Confirms and logs Javascript alerts, providing the default value.
+ */
+ @Override
+ public boolean onJsPrompt(WebView view, String url, String message,
+ String defaultValue, JsPromptResult result) {
+ String logMsg = String.format("JS Prompt '%s' received from %s; " +
+ "Giving default value '%s'", message, url, defaultValue);
+ Log.w(TAG, logMsg);
+ result.confirm(defaultValue);
+
+ return true;
+ }
+ });
+
+ webView.setWebViewClient(new TestWebViewClient(webView.getWebViewClient()) {
+
+ /**
+ * Bypasses and logs errors.
+ */
+ @Override
+ public void onReceivedError(WebView view, int errorCode,
+ String description, String failingUrl) {
+ String message = String.format("Error '%s' (%d) loading url: %s",
+ description, errorCode, failingUrl);
+ Log.w(TAG, message);
+ }
+
+ /**
+ * Ignores and logs SSL errors.
+ */
+ @Override
+ public void onReceivedSslError(WebView view, SslErrorHandler handler,
+ SslError error) {
+ Log.w(TAG, "SSL error: " + error);
+ handler.proceed();
+ }
+
+ });
+ }
+
+ public synchronized void testComplete() {
+ mTestDone = true;
+ notify();
+ }
+
+ public void testJNIBindings() {
+ setUpBrowser();
+
+ Tab tab = mActivity.getTabControl().getCurrentTab();
+ WebView webView = tab.getWebView();
+ webView.loadUrl("file:///sdcard/bindings_test.html");
+ synchronized(this) {
+ while(!mTestDone) {
+ try {
+ wait();
+ } catch (InterruptedException e) {}
+ }
+ }
+
+ // Now the tests are complete grab the DOM content and compare to the reference.
+ GetWebKitDataThread getWKData = new GetWebKitDataThread(this, webView);
+ mWebKitResult = null;
+ getWKData.start();
+
+ synchronized(this) {
+ while(mWebKitResult == null) {
+ try {
+ wait();
+ } catch (InterruptedException e) {}
+ }
+ }
+
+ Log.v(TAG, "WebKit result:");
+ Log.v(TAG, mWebKitResult);
+ assertEquals("Bindings test failed! See logcat for more details!", mExpectedWebKitResult,
+ mWebKitResult);
+ }
+}