+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- >
-
- <TextView android:id="@+id/message"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- />
-
- <EditText android:id="@+id/value"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:textStyle="bold"
- android:selectAllOnFocus="true"
- android:scrollHorizontally="true"
- android:layout_marginTop="6dip"
- />
-
-</LinearLayout>
<item android:id="@+id/goto_menu_id"
android:title="@string/goto_dot"
android:alphabeticShortcut="l"
- android:icon="@drawable/ic_menu_goto" />
+ android:icon="@*android:drawable/ic_menu_goto" />
<item android:id="@+id/search_menu_id"
android:title="@string/search"
android:icon="@android:drawable/ic_menu_search"/>
<item android:id="@+id/back_menu_id"
android:title="@string/back"
android:alphabeticShortcut="j"
- android:icon="@drawable/ic_menu_back" />
+ android:icon="@*android:drawable/ic_menu_back" />
<item android:id="@+id/close_menu_id"
android:title="@string/close"
android:alphabeticShortcut="w"
<item android:id="@+id/homepage_menu_id"
android:title="@string/homepage"
android:alphabeticShortcut=" "
- android:icon="@drawable/ic_menu_home" />
+ android:icon="@*android:drawable/ic_menu_home" />
<item android:id="@+id/classic_history_menu_id"
android:icon="@android:drawable/ic_menu_recent_history"
android:alphabeticShortcut="h"
<!-- these items are toggled in and out of @+id/stop_reload_menu_id -->
<item android:id="@+id/stop_menu_id"
android:title="@string/stop"
- android:icon="@drawable/ic_menu_stop"
+ android:icon="@*android:drawable/ic_menu_stop"
android:visible="false" />
<item android:id="@+id/reload_menu_id"
android:title="@string/reload"
- android:icon="@android:drawable/ic_menu_refresh"
+ android:icon="@*android:drawable/ic_menu_refresh"
android:visible="false" />
</menu>
<item android:id="@+id/download_menu_clear_all"
android:title="@string/download_menu_clear_all"
- android:icon="@drawable/ic_menu_clear_playlist" />
+ android:icon="@*android:drawable/ic_menu_clear_playlist" />
<item android:id="@+id/download_menu_cancel_all"
android:title="@string/download_menu_cancel_all"
android:icon="@android:drawable/ic_menu_close_clear_cancel" />
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Přihlásit se: <xliff:g id="HOSTNAME">%s1</xliff:g> <xliff:g id="REALM">%s2</xliff:g>"</string>
<string name="username">"Název"</string>
<string name="password">"Heslo"</string>
<string name="new_window">"Nové okno"</string>
<string name="goto_dot">"Přejít na adresu URL"</string>
<string name="find_dot">"Vyhledat na stránce"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Plocha"</string>
<string name="view_tabs">"Přehled okna"</string>
<string name="view_tabs_condensed">"Windows"</string>
<string name="search_hint">"Zadejte webovou adresu"</string>
<string name="search">"Hledat"</string>
<string name="search_button_text">"Přejít"</string>
- <string name="js_dialog_title_prefix">"Sdělení ze stránky"</string>
- <string name="js_dialog_title_suffix">":"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"Chcete opustit tuto stránku?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Vyberte OK, chcete-li pokračovat, nebo Zrušit, chcete-li na stránce zůstat."</string>
<string name="attention">"Upozornění"</string>
<string name="popup_window_attempt">"Tato stránka se pokouší otevřít vyskakovací okno."</string>
<string name="allow">"Povolit"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Bei <xliff:g id="HOSTNAME">%s1</xliff:g> \"<xliff:g id="REALM">%s2</xliff:g>\" anmelden"</string>
<string name="username">"Name"</string>
<string name="password">"Passwort"</string>
<string name="new_window">"Neues Fenster"</string>
<string name="goto_dot">"Gehe zu URL"</string>
<string name="find_dot">"Auf Seite suchen"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Startseite"</string>
<string name="view_tabs">"Fensterübersicht"</string>
<string name="view_tabs_condensed">"Windows"</string>
<string name="pref_content_block_popups">"Popup-Fenster blockieren"</string>
<string name="pref_content_javascript">"JavaScript aktivieren"</string>
<string name="pref_content_open_in_background">"Im Hintergrund öffnen"</string>
- <string name="pref_content_open_in_background_summary">"Neue Fenster hinter dem aktuellen Fenster geöffnet"</string>
+ <string name="pref_content_open_in_background_summary">"Neue Fenster hinter dem aktuellen Fenster öffnen"</string>
<string name="pref_content_homepage">"Startseite festlegen"</string>
<string name="pref_content_autofit">"Seiten autom. anpassen"</string>
<string name="pref_content_autofit_summary">"Webseiten an den Bildschirm anpassen"</string>
<string name="search_hint">"Webadresse eingeben"</string>
<string name="search">"Suche"</string>
<string name="search_button_text">"Los"</string>
- <string name="js_dialog_title_prefix">"Die Seite auf"</string>
- <string name="js_dialog_title_suffix">"zeigt an:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"Von dieser Seite navigieren?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Wählen Sie \"OK\", um fortzufahren, oder wählen Sie \"Abbrechen\", um auf der aktuellen Seite zu bleiben."</string>
<string name="attention">"Achtung"</string>
<string name="popup_window_attempt">"Diese Website versucht, ein Pop-up-Fenster zu öffnen."</string>
<string name="allow">"Zulassen"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Acceder a <xliff:g id="HOSTNAME">%s1</xliff:g> \"<xliff:g id="REALM">%s2</xliff:g>\""</string>
<string name="username">"Nombre"</string>
<string name="password">"Contraseña"</string>
<string name="new_window">"Nueva ventana"</string>
<string name="goto_dot">"Ir a URL"</string>
<string name="find_dot">"Buscar en la página"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Página principal"</string>
<string name="view_tabs">"Visión general de ventanas"</string>
<string name="view_tabs_condensed">"Windows"</string>
<string name="search_hint">"Introduce la dirección web."</string>
<string name="search">"Buscar"</string>
<string name="search_button_text">"Ir"</string>
- <string name="js_dialog_title_prefix">"La página"</string>
- <string name="js_dialog_title_suffix">"dice:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"¿Quieres salir de esta página?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Selecciona \"Aceptar\" para continuar o \"Cancelar\" para permanecer en la página actual."</string>
<string name="attention">"Atención"</string>
<string name="popup_window_attempt">"Este sitio está intentando mostrar una ventana emergente."</string>
<string name="allow">"Permitir"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Connectez-vous à <xliff:g id="HOSTNAME">%s1</xliff:g> \"<xliff:g id="REALM">%s2</xliff:g>\""</string>
<string name="username">"Nom"</string>
<string name="password">"Mot de passe"</string>
<string name="new_window">"Nouvelle fenêtre"</string>
<string name="goto_dot">"Accéder à l\'URL"</string>
<string name="find_dot">"Rechercher sur la page"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Page d\'accueil"</string>
<string name="view_tabs">"Vue d\'ensemble des fenêtres"</string>
<string name="view_tabs_condensed">"Windows"</string>
<string name="search_hint">"Saisir l\'adresse Web"</string>
<string name="search">"Rechercher"</string>
<string name="search_button_text">"Aller"</string>
- <string name="js_dialog_title_prefix">"La page à l\'adresse"</string>
- <string name="js_dialog_title_suffix">"indique que :"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"Vous souhaitez quitter cette page ?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Sélectionnez OK pour continuer ou Annuler pour rester sur la page actuelle."</string>
<string name="attention">"Attention"</string>
<string name="popup_window_attempt">"Le site tente d\'ouvrir une fenêtre contextuelle."</string>
<string name="allow">"Autoriser"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Accedi a <xliff:g id="HOSTNAME">%s1</xliff:g> \"<xliff:g id="REALM">%s2</xliff:g>\""</string>
<string name="username">"Nome"</string>
<string name="password">"Password"</string>
<string name="new_window">"Nuova finestra"</string>
<string name="goto_dot">"Vai a URL"</string>
<string name="find_dot">"Trova nella pagina"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Home page"</string>
<string name="view_tabs">"Anteprima finestre"</string>
<string name="view_tabs_condensed">"Finestre"</string>
<string name="search_hint">"Digita l\'indirizzo web"</string>
<string name="search">"Cerca"</string>
<string name="search_button_text">"Vai"</string>
- <string name="js_dialog_title_prefix">"La pagina all\'indirizzo"</string>
- <string name="js_dialog_title_suffix">"invia il messaggio:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"Uscire da questa pagina?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Seleziona OK per continuare o Annulla per rimanere nella pagina corrente."</string>
<string name="attention">"Attenzione"</string>
<string name="popup_window_attempt">"Il sito sta tentando di aprire una finestra pop-up."</string>
<string name="allow">"Consenti"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"<xliff:g id="HOSTNAME">%s1</xliff:g>に「<xliff:g id="REALM">%s2</xliff:g>」でログイン"</string>
<string name="username">"名前"</string>
<string name="password">"パスワード"</string>
<string name="new_window">"新しいウィンドウ"</string>
<string name="goto_dot">"URLに移動"</string>
<string name="find_dot">"このページの検索"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"ホームページ"</string>
<string name="view_tabs">"ウィンドウリスト"</string>
<string name="view_tabs_condensed">"ウィンドウ"</string>
<string name="search_hint">"ウェブアドレスを入力してください"</string>
<string name="search">"検索"</string>
<string name="search_button_text">"移動"</string>
- <string name="js_dialog_title_prefix">"ページ"</string>
- <string name="js_dialog_title_suffix">":"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"このページから移動しますか?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"続行する場合は[OK]、今のページに残る場合は[キャンセル]を選択してください。"</string>
<string name="attention">"注意"</string>
<string name="popup_window_attempt">"このサイトはポップアップウィンドウを開こうとしています。"</string>
<string name="allow">"許可"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Aanmelden bij <xliff:g id="HOSTNAME">%s1</xliff:g> \'<xliff:g id="REALM">%s2</xliff:g>\'"</string>
<string name="username">"Naam"</string>
<string name="password">"Wachtwoord"</string>
<string name="new_window">"Nieuw venster"</string>
<string name="goto_dot">"Ga naar URL"</string>
<string name="find_dot">"Zoeken op pagina"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Startpagina"</string>
<string name="view_tabs">"Vensteroverzicht"</string>
<string name="view_tabs_condensed">"Windows"</string>
<string name="search_hint">"Typ het webadres"</string>
<string name="search">"Zoeken"</string>
<string name="search_button_text">"Ga"</string>
- <string name="js_dialog_title_prefix">"De pagina op"</string>
- <string name="js_dialog_title_suffix">"zegt:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"Wilt u deze pagina verlaten?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Kies OK om door te gaan of Annuleren om op de huidige pagina te blijven."</string>
<string name="attention">"Opgelet"</string>
<string name="popup_window_attempt">"Deze site probeert een pop-upvenster te openen."</string>
<string name="allow">"Toestaan"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Zaloguj się w witrynie <xliff:g id="HOSTNAME">%s1</xliff:g> „<xliff:g id="REALM">%s2</xliff:g>”"</string>
<string name="username">"Nazwa"</string>
<string name="password">"Hasło"</string>
<string name="new_window">"Nowe okno"</string>
<string name="goto_dot">"Przejdź pod adres URL"</string>
<string name="find_dot">"Znajdź na stronie"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Strona główna"</string>
<string name="view_tabs">"Przegląd okien"</string>
<string name="view_tabs_condensed">"Windows"</string>
<string name="search_hint">"Wpisz adres WWW"</string>
<string name="search">"Szukaj"</string>
<string name="search_button_text">"Idź"</string>
- <string name="js_dialog_title_prefix">"Strona pod adresem"</string>
- <string name="js_dialog_title_suffix">"mówi:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"Czy opuścić tę stronę?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Wybierz polecenie OK, aby kontynuować, lub Anuluj, aby pozostać na tej stronie."</string>
<string name="attention">"Uwaga"</string>
<string name="popup_window_attempt">"Ta strona próbuje otworzyć okienko wyskakujące."</string>
<string name="allow">"Zezwól"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"Регистрация в <xliff:g id="HOSTNAME">%s1</xliff:g> \"<xliff:g id="REALM">%s2</xliff:g>\""</string>
<string name="username">"Название"</string>
<string name="password">"Пароль"</string>
<string name="new_window">"Новое окно"</string>
<string name="goto_dot">"Перейти к URL"</string>
<string name="find_dot">"Найти на странице"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"Главная страница"</string>
<string name="view_tabs">"Обзор окон"</string>
<string name="view_tabs_condensed">"Окна"</string>
<string name="search_hint">"Введите веб-адрес"</string>
<string name="search">"Поиск"</string>
<string name="search_button_text">"Перейти"</string>
- <string name="js_dialog_title_prefix">"На странице по адресу"</string>
- <string name="js_dialog_title_suffix">"сказано:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"Перейти с этой страницы?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Нажмите \"ОК\", чтобы продолжить, или \"Отмена\", чтобы остаться на текущей странице."</string>
<string name="attention">"Внимание"</string>
<string name="popup_window_attempt">"Этот сайт пытается открыть всплывающее окно."</string>
<string name="allow">"Разрешить"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"登录至 <xliff:g id="HOSTNAME">%s1</xliff:g>“<xliff:g id="REALM">%s2</xliff:g>”"</string>
<string name="username">"名称"</string>
<string name="password">"密码"</string>
<string name="new_window">"新窗口"</string>
<string name="goto_dot">"转至网址"</string>
<string name="find_dot">"在页面上查找"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"主页"</string>
<string name="view_tabs">"窗口概述"</string>
<string name="view_tabs_condensed">"窗口"</string>
<string name="search_hint">"键入网址"</string>
<string name="search">"搜索"</string>
<string name="search_button_text">"转至"</string>
- <string name="js_dialog_title_prefix">"该页面位于"</string>
- <string name="js_dialog_title_suffix">"显示:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"是否从该页面导航至它处?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"选择“确定”继续,或选择“取消”留在当前页面。"</string>
<string name="attention">"注意"</string>
<string name="popup_window_attempt">"该网站正试图打开一个弹出窗口。"</string>
<string name="allow">"允许"</string>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for application_name (1935869255545976415) -->
+ <skip />
<string name="sign_in_to">"登入到 <xliff:g id="HOSTNAME">%s1</xliff:g>「<xliff:g id="REALM">%s2</xliff:g>」"</string>
<string name="username">"名字"</string>
<string name="password">"密碼"</string>
<string name="new_window">"新視窗"</string>
<string name="goto_dot">"前往網址"</string>
<string name="find_dot">"在頁面中尋找"</string>
+ <!-- no translation found for select_dot (6299170761900561967) -->
+ <skip />
<string name="homepage">"首頁"</string>
<string name="view_tabs">"視窗總覽"</string>
<string name="view_tabs_condensed">"視窗"</string>
<string name="search_hint">"輸入網頁位址"</string>
<string name="search">"搜尋"</string>
<string name="search_button_text">"前往"</string>
- <string name="js_dialog_title_prefix">"此網頁:"</string>
- <string name="js_dialog_title_suffix">"描述:"</string>
- <string name="js_dialog_title_default">"JavaScript"</string>
- <string name="js_dialog_before_unload">"離開此頁?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n" 選取確定,離開此頁;或取消,留在此頁。"</string>
<string name="attention">"注意"</string>
<string name="popup_window_attempt">"此網站試圖開啟快顯視窗。"</string>
<string name="allow">"允許"</string>
<!-- This is the button label in the "Go To" UI. -->
<string name="search_button_text">Go</string>
- <!-- Part of the title for a JavaScript dialog. The full sentence says "The
- page at <url of current page> says:" followed by the message
- provided by the page -->
- <string name="js_dialog_title_prefix">The page at</string>
- <!-- Part of the title for a JavaScript dialog. The full sentence says "The
- page at <url of current page> says:" followed by the message
- provided by the page -->
- <string name="js_dialog_title_suffix">says:</string>
- <!-- Default title for a javascript dialog -->
- <string name="js_dialog_title_default">JavaScript</string>
- <!-- Message in a javascript dialog asking if the user wishes to leave the
- current page -->
- <string name="js_dialog_before_unload">Navigate away from this page?\n\n<xliff:g id="message">%s</xliff:g>\n\nSelect OK to continue, or Cancel to stay on the current page.</string>
-
<!-- Pop-up window dialog -->
<!-- Title for a dialog informing the user that the site is attempting to
display a popup window -->
import android.graphics.drawable.PaintDrawable;
import android.hardware.SensorListener;
import android.hardware.SensorManager;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
import android.net.Uri;
import android.net.WebAddress;
import android.net.http.EventHandler;
import android.net.http.SslCertificate;
import android.net.http.SslError;
import android.os.AsyncTask;
-import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.Environment;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Browser;
-import android.provider.Checkin;
import android.provider.Contacts.Intents.Insert;
import android.provider.Contacts;
import android.provider.Downloads;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
-import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.webkit.CookieSyncManager;
import android.webkit.DownloadListener;
import android.webkit.HttpAuthHandler;
-import android.webkit.JsPromptResult;
-import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
import android.webkit.URLUtil;
import android.webkit.WebChromeClient;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.Vector;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import java.util.zip.ZipInputStream;
public class BrowserActivity extends Activity
implements KeyTracker.OnKeyTracker,
if (googleUser == null || !hostedUser.equals(googleUser)) {
String domain = hostedUser.substring(hostedUser.lastIndexOf('@')+1);
- homepage = "http://www.google.com/m/a/" + domain;
+ homepage = "http://www.google.com/m/a/" + domain + "?client=ms-" +
+ SystemProperties.get("ro.com.google.clientid", "unknown");
}
} catch (RemoteException ignore) {
// Login service died; carry on
resumeAfterCredentials();
// as this is running in a separate thread,
- // BrowserActivity's onDestroy() may have been called,
+ // BrowserActivity's onDestroy() may have been called,
// which also calls unbindService().
if (mGlsConnection != null) {
// we no longer need to keep GLS open
mGenericFavicon = getResources().getDrawable(
R.drawable.app_web_browser_sm);
-
- mContentView = new FrameLayout(this);
-
- setContentView(mContentView);
+ mContentView = (FrameLayout) getWindow().getDecorView().findViewById(
+ com.android.internal.R.id.content);
// Create the tab control and our initial tab
mTabControl = new TabControl(this);
}
final String action = intent.getAction();
final int flags = intent.getFlags();
- if (Intent.ACTION_MAIN.equals(action) ||
+ if (Intent.ACTION_MAIN.equals(action) ||
(flags & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
// just resume the browser
return;
if (url == null || url.length() == 0) {
url = mSettings.getHomePage();
}
- if (Intent.ACTION_VIEW.equals(action) &&
+ if (Intent.ACTION_VIEW.equals(action) &&
(flags & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
// if FLAG_ACTIVITY_BROUGHT_TO_FRONT flag is on, the url will be
// opened in a new tab unless we have reached MAX_TABS. Then the
/**
* Looking for the pattern like this
- *
+ *
* *
* * *
* *** * *******
public void onSensorChanged(int sensor, float[] values) {
boolean show = false;
float[] diff = new float[3];
-
+
for (int i = 0; i < 3; i++) {
diff[i] = values[i] - mPrev[i];
if (Math.abs(diff[i]) > 1) {
public void onAccuracyChanged(int sensor, int accuracy) {
// TODO Auto-generated method stub
-
+
}
};
// the default implementation requires each view to have an id. As the
// browser handles the state itself and it doesn't use id for the views,
// don't call the default implementation. Otherwise it will trigger the
- // warning like this, "couldn't save which view has focus because the
+ // warning like this, "couldn't save which view has focus because the
// focused view XXX has no id".
// Save all the tabs
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
-
+
if (mPageInfoDialog != null) {
mPageInfoDialog.dismiss();
showPageInfo(
}
private boolean resumeWebView() {
- if ((!mActivityInPause && !mPageStarted) ||
+ if ((!mActivityInPause && !mPageStarted) ||
(mActivityInPause && mPageStarted)) {
CookieSyncManager.getInstance().startSync();
WebView w = mTabControl.getCurrentWebView();
mCredsDlg = new ProgressDialog(this);
mCredsDlg.setIndeterminate(true);
mCredsDlg.setMessage(getText(R.string.retrieving_creds_dlg_msg));
- // If the user cancels the operation, then cancel the Google
+ // If the user cancels the operation, then cancel the Google
// Credentials request.
mCredsDlg.setCancelMessage(mHandler.obtainMessage(CANCEL_CREDS_REQUEST));
mCredsDlg.show();
}
@Override
- public void startSearch(String initialQuery, boolean selectInitialQuery,
+ public void startSearch(String initialQuery, boolean selectInitialQuery,
Bundle appSearchData, boolean globalSearch) {
if (appSearchData == null) {
appSearchData = createGoogleSearchSourceBundle(GOOGLE_SEARCH_SOURCE_TYPE);
Browser.saveBookmark(this, getTopWindow().getTitle(),
getTopWindow().getUrl());
break;
-
+
case R.id.share_page_menu_id:
Browser.sendString(this, getTopWindow().getUrl());
break;
-
+
case R.id.dump_nav_menu_id:
getTopWindow().debugDump();
break;
case R.id.view_downloads_menu_id:
viewDownloads(null);
break;
-
+
case R.id.flip_orientation_menu_id:
- if (mSettings.getOrientation() !=
+ if (mSettings.getOrientation() !=
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
- mSettings.setOrientation(this,
+ mSettings.setOrientation(this,
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
mSettings.setOrientation(this,
for (int id = 0; id < WINDOW_SHORTCUT_ID_ARRAY.length; id++) {
if (WINDOW_SHORTCUT_ID_ARRAY[id] == menuid) {
TabControl.Tab desiredTab = mTabControl.getTab(id);
- if (desiredTab != null &&
+ if (desiredTab != null &&
desiredTab != mTabControl.getCurrentTab()) {
switchTabs(mTabControl.getCurrentIndex(), id, false);
}
break;
- }
+ }
}
}
break;
-
+
default:
if (!super.onOptionsItemSelected(item)) {
return false;
final MenuItem back = menu.findItem(R.id.back_menu_id);
back.setVisible(canGoBack);
back.setEnabled(canGoBack);
- final MenuItem flip =
+ final MenuItem flip =
menu.findItem(R.id.flip_orientation_menu_id);
- boolean keyboardClosed =
- getResources().getConfiguration().hardKeyboardHidden ==
+ boolean keyboardClosed =
+ getResources().getConfiguration().hardKeyboardHidden ==
Configuration.HARDKEYBOARDHIDDEN_YES;
flip.setEnabled(keyboardClosed);
menu.findItem(R.id.zoom_in_menu_id).setVisible(false);
menu.findItem(R.id.zoom_out_menu_id).setVisible(false);
-
+
// decide whether to show the share link option
PackageManager pm = getPackageManager();
Intent send = new Intent(Intent.ACTION_SEND);
PackageManager.MATCH_DEFAULT_ONLY);
menu.findItem(R.id.share_page_menu_id).setVisible(
list.size() > 0);
-
+
// Hide the menu+<window number> items
// Can't set visibility in menu xml file b/c when a
// group is set visible, all items are set visible.
mText = toCopy;
}
}
-
+
private class Download implements OnMenuItemClickListener {
private String mText;
public final static int STOP_LOAD = 1002;
// Message Ids
- private static final int JS_CONFIRM = 101;
private static final int FOCUS_NODE_HREF = 102;
private static final int CANCEL_CREDS_REQUEST = 103;
private static final int ANIMATE_FROM_OVERVIEW = 104;
public void handleMessage(Message msg) {
switch (msg.what) {
- case JS_CONFIRM:
- JsResult res = (JsResult) msg.obj;
- if (msg.arg1 == 0) {
- res.cancel();
- } else {
- res.confirm();
- }
- break;
-
case ANIMATE_FROM_OVERVIEW:
final HashMap map = (HashMap) msg.obj;
animateFromTabOverview((AnimatingView) map.get("view"),
&& mWebView.getContext() != null
&& mWebView.getContext().getSystemService(
Context.CONNECTIVITY_SERVICE) != null) {
- ConnectivityManager cManager =
+ ConnectivityManager cManager =
(ConnectivityManager) mWebView
.getContext().getSystemService(
Context.CONNECTIVITY_SERVICE);
mTabControl.createSubWindow();
final TabControl.Tab t = mTabControl.getCurrentTab();
attachSubWindow(t);
- WebView.WebViewTransport transport =
+ WebView.WebViewTransport transport =
(WebView.WebViewTransport) msg.obj;
transport.setWebView(t.getSubWebView());
msg.sendToTarget();
try {
url = "%" + url;
String [] selArgs = new String[] { url };
-
+
String where = Browser.BookmarkColumns.URL + " LIKE ? AND "
+ Browser.BookmarkColumns.BOOKMARK + " = 0";
Cursor c = mResolver.query(Browser.BOOKMARKS_URI,
public void onReceivedIcon(WebView view, Bitmap icon) {
updateIcon(view.getUrl(), icon);
}
-
- //----------------------------------------------------------------------
- // JavaScript functions.
- //----------------------------------------------------------------------
-
- // Show an alert to the user.
- @Override
- public boolean onJsAlert(WebView view, String url, String message,
- JsResult result) {
- String title = url;
- if (URLUtil.isDataUrl(url)) {
- // For data: urls, we just display 'JavaScript' similar to
- // Safari.
- title = getString(R.string.js_dialog_title_default);
- } else {
- try {
- URL aUrl = new URL(url);
- // Example: "The page at 'http://www.mit.edu' says:"
- title = getText(R.string.js_dialog_title_prefix)
- + " '"
- + (aUrl.getProtocol() + "://" + aUrl.getHost())
- + "' "
- + getText(R.string.js_dialog_title_suffix);
- } catch (MalformedURLException ex) {
- // do nothing. just use the url passed as the title
- }
- }
- final JsResult res = result;
- new AlertDialog.Builder(BrowserActivity.this)
- .setTitle(title)
- .setMessage(message)
- .setPositiveButton(R.string.ok,
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int which) {
- res.confirm();
- }
- })
- .setCancelable(false)
- .show();
- return true;
- }
-
- @Override
- public boolean onJsConfirm(WebView view, String url, String message,
- final JsResult result) {
- String title = url;
- try {
- URL aUrl = new URL(url);
- // Example: "The page at 'http://www.mit.edu' says:"
- title = getText(R.string.js_dialog_title_prefix)
- + " '"
- + (aUrl.getProtocol() + "://" + aUrl.getHost())
- + "' "
- + getText(R.string.js_dialog_title_suffix);
- } catch (MalformedURLException ex) {
- // do nothing. just use the url passed as the title
- }
- new AlertDialog.Builder(BrowserActivity.this)
- .setTitle(title)
- .setMessage(message)
- .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- mHandler.obtainMessage(JS_CONFIRM, 1, 0, result).sendToTarget();
- }})
- .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- mHandler.obtainMessage(JS_CONFIRM, 0, 0, result).sendToTarget();
- }})
- .show();
- // Return true so WebView knows we will handle the confirm.
- return true;
- }
-
- @Override
- public boolean onJsPrompt(WebView view, String url, String message, String defaultValue,
- final JsPromptResult result) {
- String title = url;
- try {
- URL aUrl = new URL(url);
- // Example: "The page at 'http://www.mit.edu' says:"
- title = getText(R.string.js_dialog_title_prefix)
- + " '"
- + (aUrl.getProtocol() + "://" + aUrl.getHost())
- + "' "
- + getText(R.string.js_dialog_title_suffix);
- } catch (MalformedURLException ex) {
- // do nothing, just use the url passed as the title
- }
-
- final LayoutInflater factory = LayoutInflater.from(BrowserActivity.this);
- final View v = factory.inflate(R.layout.js_prompt, null);
- ((TextView)v.findViewById(R.id.message)).setText(message);
- ((EditText)v.findViewById(R.id.value)).setText(defaultValue);
-
- new AlertDialog.Builder(BrowserActivity.this)
- .setTitle(title)
- .setView(v)
- .setPositiveButton(R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- String value = ((EditText)v.findViewById(R.id.value)).getText()
- .toString();
- result.confirm(value);
- }
- })
- .setNegativeButton(R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- result.cancel();
- }
- })
- .setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- result.cancel();
- }
- })
- .show();
-
- // Return true so WebView knows we will handle the prompt.
- return true;
- }
-
- @Override
- public boolean onJsBeforeUnload(WebView view, String url,
- String message, final JsResult result) {
- final String m =
- getString(R.string.js_dialog_before_unload, message);
- new AlertDialog.Builder(BrowserActivity.this)
- .setMessage(m)
- .setPositiveButton(R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int which) {
- // Use JS_CONFIRM since it has the same
- // behavior we want here.
- mHandler.obtainMessage(JS_CONFIRM, 1, 0,
- result).sendToTarget();
- }})
- .setNegativeButton(R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int which) {
- // Use JS_CONFIRM since it has the same
- // behavior we want here.
- mHandler.obtainMessage(JS_CONFIRM, 0, 0,
- result).sendToTarget();
- }})
- .show();
- // Return true so WebView knows we will handle the dialog.
- return true;
- }
};
/**
.from(this);
final View pageInfoView = factory.inflate(R.layout.page_info, null);
-
+
final WebView view = tab.getWebView();
String url = null;
// if we have a main top-level page SSL certificate set or a certificate
// error
- if (fromShowSSLCertificateOnError ||
+ if (fromShowSSLCertificateOnError ||
(view != null && view.getCertificate() != null)) {
// add a 'View Certificate' button
alertDialogBuilder.setNeutralButton(
// need to show the dialog again once the
// user is done exploring the page-info details
- showPageInfo(mTabControl.getTabFromView(view),
+ showPageInfo(mTabControl.getTabFromView(view),
true);
}
})
}
getTopWindow().requestFocus();
}
-
+
/*
* This method is called as a result of the user selecting the options
* menu to see the download window, or when a download changes state. It
// overlap. A count of 0 means no animation where a count of > 0 means
// there are animations in progress.
private int mAnimationCount;
-
+
// As the ids are dynamically created, we can't guarantee that they will
// be in sequence, so this static array maps ids to a window number.
- final static private int[] WINDOW_SHORTCUT_ID_ARRAY =
+ final static private int[] WINDOW_SHORTCUT_ID_ARRAY =
{ R.id.window_one_menu_id, R.id.window_two_menu_id, R.id.window_three_menu_id,
R.id.window_four_menu_id, R.id.window_five_menu_id, R.id.window_six_menu_id,
R.id.window_seven_menu_id, R.id.window_eight_menu_id };
}
if (mBackIcon == null) {
mBackIcon = BitmapFactory.decodeResource(getResources(),
- R.drawable.gears_back);
+ com.android.internal.R.drawable.ic_menu_back);
}
}
}
mActivity.dismissSubWindow(mTab);
}
- // JavaScript functions
- @Override
- public boolean onJsAlert(WebView view, String url, String message,
- JsResult result) {
- return mClient.onJsAlert(view, url, message, result);
- }
- @Override
- public boolean onJsConfirm(WebView view, String url, String message,
- JsResult result) {
- return mClient.onJsConfirm(view, url, message, result);
- }
- @Override
- public boolean onJsPrompt(WebView view, String url, String message,
- String initValue, JsPromptResult result) {
- return mClient.onJsPrompt(view, url, message, initValue, result);
- }
- @Override
- public boolean onJsBeforeUnload(WebView view, String url,
- String message, JsResult result) {
- return mClient.onJsBeforeUnload(view, url, message, result);
- }
}
// Background WebChromeClient for focusing tabs
private class BackgroundChromeClient extends WebChromeClient {