summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-01-14 22:38:23 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-01-14 22:38:23 +0100
commit8fcddf0bfebcbe5668d2336a27b62ce45c8a79d7 (patch)
tree72bbea2e0d18c6c6c90b8fa9b71446e99c01ac9f
parent471f186c9fb1f47da507d595c05ed7992dea0bf3 (diff)
parentf99d46686191704cc9f79f8bea229d4e9291bbce (diff)
downloadpackages_apps_Browser-8fcddf0bfebcbe5668d2336a27b62ce45c8a79d7.tar.gz
packages_apps_Browser-8fcddf0bfebcbe5668d2336a27b62ce45c8a79d7.tar.bz2
packages_apps_Browser-8fcddf0bfebcbe5668d2336a27b62ce45c8a79d7.zip
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_packages_apps_Browser into HEAD
-rw-r--r--AndroidManifest.xml3
-rw-r--r--res/layout-land/nav_screen.xml1
-rw-r--r--res/layout/nav_screen.xml1
-rw-r--r--res/menu/browser.xml5
-rw-r--r--res/values-de/cm_strings.xml4
-rw-r--r--res/values-el/cm_strings.xml8
-rw-r--r--res/values-en-rIN/cm_strings.xml28
-rw-r--r--res/values-es/cm_strings.xml2
-rw-r--r--res/values-fr/cm_strings.xml5
-rw-r--r--res/values-gl-rES/cm_strings.xml33
-rw-r--r--res/values-hr/cm_strings.xml33
-rw-r--r--res/values-hu/cm_strings.xml28
-rw-r--r--res/values-it/cm_strings.xml5
-rw-r--r--res/values-iw/cm_strings.xml1
-rw-r--r--res/values-nb/cm_strings.xml26
-rw-r--r--res/values-nl/cm_strings.xml28
-rw-r--r--res/values-pl/cm_strings.xml6
-rw-r--r--res/values-pt-rBR/cm_strings.xml28
-rw-r--r--res/values-ro/cm_strings.xml23
-rw-r--r--res/values-ru/cm_strings.xml2
-rw-r--r--res/values-sl/cm_strings.xml28
-rw-r--r--res/values-sv/cm_strings.xml23
-rw-r--r--res/values-th/cm_strings.xml28
-rw-r--r--res/values-tr/cm_strings.xml28
-rw-r--r--res/values-zh-rCN/cm_strings.xml7
-rw-r--r--res/values/cm_strings.xml6
-rw-r--r--src/com/android/browser/BrowserActivity.java29
-rw-r--r--src/com/android/browser/Controller.java4
-rwxr-xr-xsrc/com/android/browser/DownloadHandler.java64
-rw-r--r--src/com/android/browser/PermissionsActivity.java143
-rw-r--r--src/com/android/browser/PermissionsPrompt.java39
-rw-r--r--src/com/android/browser/PhoneUi.java12
-rw-r--r--src/com/android/browser/Tab.java3
33 files changed, 670 insertions, 14 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0ffdec4df..53c6325e7 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -20,7 +20,8 @@
<original-package android:name="com.android.browser" />
- <uses-sdk android:minSdkVersion="21"/>
+ <uses-sdk android:minSdkVersion="21"
+ android:targetSdkVersion="23" />
<uses-feature android:name="android.software.leanback"
android:required="false" />
diff --git a/res/layout-land/nav_screen.xml b/res/layout-land/nav_screen.xml
index 409157320..ac70ab2bd 100644
--- a/res/layout-land/nav_screen.xml
+++ b/res/layout-land/nav_screen.xml
@@ -49,7 +49,6 @@
style="@style/BrowserButton"
android:gravity="center_vertical"
android:contentDescription="@string/accessibility_button_newincognitotab"
- android:visibility="gone"
android:src="@drawable/ic_incognito" />
<ImageButton
android:id="@+id/newtab"
diff --git a/res/layout/nav_screen.xml b/res/layout/nav_screen.xml
index d028ea122..f29647853 100644
--- a/res/layout/nav_screen.xml
+++ b/res/layout/nav_screen.xml
@@ -41,7 +41,6 @@
style="@style/BrowserButton"
android:gravity="center_vertical"
android:contentDescription="@string/accessibility_button_newincognitotab"
- android:visibility="gone"
android:src="@drawable/ic_incognito" />
<ImageButton
android:id="@+id/newtab"
diff --git a/res/menu/browser.xml b/res/menu/browser.xml
index afd95657b..a0a18bc99 100644
--- a/res/menu/browser.xml
+++ b/res/menu/browser.xml
@@ -32,6 +32,11 @@
android:showAsAction="never"
android:alphabeticShortcut="n" />
<item
+ android:id="@+id/new_incognito_tab_menu_id"
+ android:title="@string/new_incognito_tab"
+ android:icon="@drawable/ic_new_window_incognito"
+ android:showAsAction="never" />
+ <item
android:id="@+id/bookmarks_menu_id"
android:title="@string/bookmarks"
android:icon="@drawable/ic_bookmarks"
diff --git a/res/values-de/cm_strings.xml b/res/values-de/cm_strings.xml
index f9518e33e..cb16137f2 100644
--- a/res/values-de/cm_strings.xml
+++ b/res/values-de/cm_strings.xml
@@ -22,5 +22,9 @@
<string name="pref_content_ua">User-Agent</string>
<string name="pref_interface_title">Oberfläche</string>
<string name="full_screen_title">Vollbild</string>
+ <string name="onehand_title">Einhand-Navigation</string>
<string name="onehand_summary">Einfachere Web-Navigation mit Wischen und Verknüpfungen</string>
+ <string name="permission_not_granted_dialog_title">Berechtigung nicht erteilt</string>
+ <string name="permission_not_granted_dialog_message">Die Berechtigung, den externen Speicher zu beschreiben, wurde nicht erteilt. Download nicht möglich.</string>
+ <string name="browser_error_title">Browser-Fehler</string>
</resources>
diff --git a/res/values-el/cm_strings.xml b/res/values-el/cm_strings.xml
index 980f754c7..6583c4361 100644
--- a/res/values-el/cm_strings.xml
+++ b/res/values-el/cm_strings.xml
@@ -22,4 +22,12 @@
<string name="pref_content_ua">User agent</string>
<string name="pref_interface_title">Διεπαφή</string>
<string name="full_screen_title">Πλήρης οθόνη</string>
+ <string name="full_screen_summary">Ενεργοποίηση πλοήγησης σε πλήρη οθόνη</string>
+ <string name="onehand_title">Πλοήγηση OneHand</string>
+ <string name="onehand_summary">Ευκολότερη περιήγηση στον ιστό με χρήση συρσίματος και γρήγορων δράσεων</string>
+ <string name="permission_not_granted_dialog_title">Η άδεια δεν χορηγήθηκε</string>
+ <string name="permission_not_granted_dialog_message">Η άδεια για εγγραφή στον εξωτερικό αποθηκευτικό χώρο δεν χορηγήθηκε. Δεν είναι δυνατή η λήψη.</string>
+ <string name="browser_error_title">Σφάλμα περιηγητή</string>
+ <string name="dialog_dismiss">Παράβλεψη</string>
+ <string name="error_permissions">Η εφαρμογή δεν έχει κρίσιμα δικαιώματα που απαιτούνται για την εκτέλεση. Παρακαλώ ελέγξτε τις ρυθμίσεις δικαιωμάτων σας.</string>
</resources>
diff --git a/res/values-en-rIN/cm_strings.xml b/res/values-en-rIN/cm_strings.xml
new file mode 100644
index 000000000..5c375aa0f
--- /dev/null
+++ b/res/values-en-rIN/cm_strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Home screen</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Open in new incognito tab</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Open in new incognito background tab</string>
+ <string name="pref_content_ua">User agent</string>
+ <string name="pref_interface_title">Interface</string>
+ <string name="full_screen_title">Fullscreen</string>
+ <string name="full_screen_summary">Enable immersive navigation</string>
+ <string name="onehand_title">OneHand Navigation</string>
+ <string name="onehand_summary">Easier web navigation with swipes and quick actions</string>
+</resources>
diff --git a/res/values-es/cm_strings.xml b/res/values-es/cm_strings.xml
index f9cc12ca4..805bc7ac4 100644
--- a/res/values-es/cm_strings.xml
+++ b/res/values-es/cm_strings.xml
@@ -19,8 +19,10 @@
<string name="accessibility_button_homescreen">Pantalla Inicial</string>
<string name="contextmenu_openlink_incognito_newwindow">Abrir nueva ventana en modo incógnito</string>
<string name="contextmenu_openlink_incognito_newwindow_background">Abrir en nueva pestaña de incognito</string>
+ <string name="pref_content_ua">Agente del usuario</string>
<string name="pref_interface_title">Interfaz</string>
<string name="full_screen_title">Pantalla completa</string>
<string name="full_screen_summary">Activar navegacion inmersiva</string>
+ <string name="onehand_title">Navegacion con una mano</string>
<string name="onehand_summary">Navegación web más fácil con desplazamientos y acciones rápidas</string>
</resources>
diff --git a/res/values-fr/cm_strings.xml b/res/values-fr/cm_strings.xml
index 26af06713..437b2443f 100644
--- a/res/values-fr/cm_strings.xml
+++ b/res/values-fr/cm_strings.xml
@@ -25,4 +25,9 @@
<string name="full_screen_summary">Activer la navigation immersive</string>
<string name="onehand_title">Navigation à une main</string>
<string name="onehand_summary">Faciliter la navigation web avec balayages et actions rapides</string>
+ <string name="permission_not_granted_dialog_title">Autorisation non accordée</string>
+ <string name="permission_not_granted_dialog_message">L\'autorisation d\'écriture sur le stockage externe n\'a pas été accordée. Le téléchargement est impossible.</string>
+ <string name="browser_error_title">Erreur du navigateur</string>
+ <string name="dialog_dismiss">Annuler</string>
+ <string name="error_permissions">L\'application ne dispose pas des autorisations critiques nécessaires à l\'exécution. Veuillez vérifier vos paramètres d\'autorisations.</string>
</resources>
diff --git a/res/values-gl-rES/cm_strings.xml b/res/values-gl-rES/cm_strings.xml
new file mode 100644
index 000000000..2b758abe4
--- /dev/null
+++ b/res/values-gl-rES/cm_strings.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Páxina inicial</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Abrir nunha nova lapela de incógnito</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Abrir en segundo plano nunha nova lapela de incógnito</string>
+ <string name="pref_content_ua">Axente de usuario</string>
+ <string name="pref_interface_title">Interface</string>
+ <string name="full_screen_title">Pantalla completa</string>
+ <string name="full_screen_summary">Activar navegacion inmersiva</string>
+ <string name="onehand_title">Navegación cunha man</string>
+ <string name="onehand_summary">Navegación web máis doada con desprazamentos e accións rápidas</string>
+ <string name="permission_not_granted_dialog_title">Permiso non concedido</string>
+ <string name="permission_not_granted_dialog_message">Non se concedeu permiso para escribir no almacenamento externo. Non se pode descargar.</string>
+ <string name="browser_error_title">Erro no navegador</string>
+ <string name="dialog_dismiss">Desestimar</string>
+ <string name="error_permissions">A aplicación non ten permisos imprescindíbeis para executarse. Comprobe a súa configuración de permisos.</string>
+</resources>
diff --git a/res/values-hr/cm_strings.xml b/res/values-hr/cm_strings.xml
new file mode 100644
index 000000000..cdb3c8625
--- /dev/null
+++ b/res/values-hr/cm_strings.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Početni zaslon</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Otvori novu anonimnu karticu</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Otvori novu anonimnu karticu u pozadini</string>
+ <string name="pref_content_ua">Korisnički agent</string>
+ <string name="pref_interface_title">Sučelje</string>
+ <string name="full_screen_title">Cijeli zaslon</string>
+ <string name="full_screen_summary">Omogući cijeli zaslon</string>
+ <string name="onehand_title">Navigacija jednom rukom</string>
+ <string name="onehand_summary">Lakša web navigacija pokretima i brzim akcijama</string>
+ <string name="permission_not_granted_dialog_title">Dozvola nije odobrena</string>
+ <string name="permission_not_granted_dialog_message">Dozvola za pisanjem na vanjsku pohranu nije odobrena. Preuzimanje nije moguće.</string>
+ <string name="browser_error_title">Pogreška preglednika</string>
+ <string name="dialog_dismiss">Odbaci</string>
+ <string name="error_permissions">Aplikacija nema potrebnu dozvolu za pokretanje. Provjerite postavke dozvola.</string>
+</resources>
diff --git a/res/values-hu/cm_strings.xml b/res/values-hu/cm_strings.xml
new file mode 100644
index 000000000..ed81473aa
--- /dev/null
+++ b/res/values-hu/cm_strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Kezdőlap</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Megnyitás új lapfülön, inkognitó módban</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Megnyitás új lapfülön, inkognitó módban (háttérben)</string>
+ <string name="pref_content_ua">Böngészőazonosító</string>
+ <string name="pref_interface_title">Felhasználói felület</string>
+ <string name="full_screen_title">Teljes képernyő</string>
+ <string name="full_screen_summary">Teljes képernyős navigáció engedélyezése</string>
+ <string name="onehand_title">Egykezes navigáció</string>
+ <string name="onehand_summary">Könnyebb web-böngészés csúsztatással és gyors műveletekkel</string>
+</resources>
diff --git a/res/values-it/cm_strings.xml b/res/values-it/cm_strings.xml
index 2c88a0839..918e6a964 100644
--- a/res/values-it/cm_strings.xml
+++ b/res/values-it/cm_strings.xml
@@ -25,4 +25,9 @@
<string name="full_screen_summary">Abilita navigazione immersiva</string>
<string name="onehand_title">Navigazione OneHand</string>
<string name="onehand_summary">Navigazione agevolata con gesture e azioni rapide</string>
+ <string name="permission_not_granted_dialog_title">Permesso non concesso</string>
+ <string name="permission_not_granted_dialog_message">Il permesso di accedere alla memoria interna non è stato concesso. Impossibile avviare download.</string>
+ <string name="browser_error_title">Errore Browser</string>
+ <string name="dialog_dismiss">Annulla</string>
+ <string name="error_permissions">L\'applicazione non dispone dei permessi necessari per avviarsi. Controlla le impostazioni relative ai permessi.</string>
</resources>
diff --git a/res/values-iw/cm_strings.xml b/res/values-iw/cm_strings.xml
index 2c4a4a165..934359af5 100644
--- a/res/values-iw/cm_strings.xml
+++ b/res/values-iw/cm_strings.xml
@@ -24,4 +24,5 @@
<string name="full_screen_title">מסך מלא</string>
<string name="full_screen_summary">אפשר ניווט במסך מלא</string>
<string name="onehand_title">ניווט OneHand</string>
+ <string name="onehand_summary">ניווט פשוט יותר ברשת באמצעות החלקות ופעולות מהירות</string>
</resources>
diff --git a/res/values-nb/cm_strings.xml b/res/values-nb/cm_strings.xml
new file mode 100644
index 000000000..15d330a21
--- /dev/null
+++ b/res/values-nb/cm_strings.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Hjem-skjermen</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Åpne i ny inkognitofane</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Åpne i ny inkognitofane i bakgrunnen</string>
+ <string name="pref_content_ua">Brukeragent</string>
+ <string name="pref_interface_title">Grensesnitt</string>
+ <string name="full_screen_title">Fullskjerm</string>
+ <string name="onehand_title">OneHand navigasjon</string>
+</resources>
diff --git a/res/values-nl/cm_strings.xml b/res/values-nl/cm_strings.xml
new file mode 100644
index 000000000..72a99d7db
--- /dev/null
+++ b/res/values-nl/cm_strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Startscherm</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Openen in nieuw incognitotabblad</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Openen in nieuw incognitotabblad op de achtergrond</string>
+ <string name="pref_content_ua">Useragent</string>
+ <string name="pref_interface_title">Uiterlijk</string>
+ <string name="full_screen_title">Volledig scherm</string>
+ <string name="full_screen_summary">Schermvullende weergave inschakelen</string>
+ <string name="onehand_title">Bedienen met één hand</string>
+ <string name="onehand_summary">Makkelijkere webnavigatie met swipes en snelle acties</string>
+</resources>
diff --git a/res/values-pl/cm_strings.xml b/res/values-pl/cm_strings.xml
index fba7d4dda..677f5bd7a 100644
--- a/res/values-pl/cm_strings.xml
+++ b/res/values-pl/cm_strings.xml
@@ -17,6 +17,12 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="accessibility_button_homescreen">Ekran główny</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Otwórz w nowej karcie incognito</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Otwórz w nowej karcie incognito w tle</string>
+ <string name="pref_content_ua">User agent</string>
<string name="pref_interface_title">Interfejs</string>
<string name="full_screen_title">Pełny ekran</string>
+ <string name="full_screen_summary">Włącz nawigację pełnoekranową</string>
+ <string name="onehand_title">Nawigacja OneHand</string>
+ <string name="onehand_summary">Łatwiejsza nawigacja w sieci z przesunięciami i szybkimi akcjami</string>
</resources>
diff --git a/res/values-pt-rBR/cm_strings.xml b/res/values-pt-rBR/cm_strings.xml
new file mode 100644
index 000000000..e9a0b4eb2
--- /dev/null
+++ b/res/values-pt-rBR/cm_strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Tela inicial</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Abrir em nova aba anônima</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Abrir uma nova aba anônima em segundo plano</string>
+ <string name="pref_content_ua">Agente de usuário</string>
+ <string name="pref_interface_title">Interface</string>
+ <string name="full_screen_title">Tela cheia</string>
+ <string name="full_screen_summary">Ativar navegação imersiva</string>
+ <string name="onehand_title">Navegação com uma mão</string>
+ <string name="onehand_summary">Navegação na web mais fácil com gestos e ações rápidas</string>
+</resources>
diff --git a/res/values-ro/cm_strings.xml b/res/values-ro/cm_strings.xml
new file mode 100644
index 000000000..a7e787e49
--- /dev/null
+++ b/res/values-ro/cm_strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="pref_content_ua">Agent utilizator</string>
+ <string name="pref_interface_title">Interfață</string>
+ <string name="full_screen_title">Pe tot ecranul</string>
+ <string name="onehand_title">Navigare cu o singură mână</string>
+</resources>
diff --git a/res/values-ru/cm_strings.xml b/res/values-ru/cm_strings.xml
index bf137beeb..7ba846cad 100644
--- a/res/values-ru/cm_strings.xml
+++ b/res/values-ru/cm_strings.xml
@@ -22,5 +22,7 @@
<string name="pref_content_ua">User Agent</string>
<string name="pref_interface_title">Интерфейс</string>
<string name="full_screen_title">Полноэкранный режим</string>
+ <string name="full_screen_summary">Скрывать строку состояния и панель навигации</string>
<string name="onehand_title">Управление одной рукой</string>
+ <string name="onehand_summary">Упрощённая веб-навигация с помощью жестов и быстрых действий</string>
</resources>
diff --git a/res/values-sl/cm_strings.xml b/res/values-sl/cm_strings.xml
new file mode 100644
index 000000000..d607c843f
--- /dev/null
+++ b/res/values-sl/cm_strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Domači zaslon</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Odpri v novem zavihku brez beleženja zgodovine</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Odpri v novem zavihku v ozadju brez beleženja zgodovine</string>
+ <string name="pref_content_ua">Uporabniški posrednik</string>
+ <string name="pref_interface_title">Vmesnik</string>
+ <string name="full_screen_title">Celozaslonski način</string>
+ <string name="full_screen_summary">Omogoči krmarjenje na celem zaslonu</string>
+ <string name="onehand_title">Krmarjenje z eno roko</string>
+ <string name="onehand_summary">Lažje krmarjenje po spletu s potegi in hitrimi dejanji</string>
+</resources>
diff --git a/res/values-sv/cm_strings.xml b/res/values-sv/cm_strings.xml
new file mode 100644
index 000000000..8d7ea2271
--- /dev/null
+++ b/res/values-sv/cm_strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Hemskärm</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Öppna i ny inkognitoflik</string>
+ <string name="pref_interface_title">Gränssnitt</string>
+ <string name="full_screen_title">Fullskärm</string>
+</resources>
diff --git a/res/values-th/cm_strings.xml b/res/values-th/cm_strings.xml
new file mode 100644
index 000000000..024b42953
--- /dev/null
+++ b/res/values-th/cm_strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">หน้าจอหลัก</string>
+ <string name="contextmenu_openlink_incognito_newwindow">เปิดใหม่ในแท็บไม่ระบุตัวตน</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">เปิดในแท็บใหม่เป็นพื้นหลังแบบไม่ระบุตัวตน</string>
+ <string name="pref_content_ua">ตัวแทนผู้ใช้</string>
+ <string name="pref_interface_title">หน้าตา</string>
+ <string name="full_screen_title">เต็มจอ</string>
+ <string name="full_screen_summary">เปิดใช้งานการนำทางเต็มหน้าจอ</string>
+ <string name="onehand_title">การนำทางมือเดียว</string>
+ <string name="onehand_summary">ใช้งานเว็บไซต์ได้ง่ายขึ้นโดยใช้การเลื่อนและกวาดนิ้วแบบรวดเร็ว</string>
+</resources>
diff --git a/res/values-tr/cm_strings.xml b/res/values-tr/cm_strings.xml
new file mode 100644
index 000000000..d8432b10f
--- /dev/null
+++ b/res/values-tr/cm_strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.com-->
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="accessibility_button_homescreen">Ana ekran</string>
+ <string name="contextmenu_openlink_incognito_newwindow">Yeni gizli sekmede aç</string>
+ <string name="contextmenu_openlink_incognito_newwindow_background">Yeni gizli arkaplan sekmesinde aç</string>
+ <string name="pref_content_ua">Kullanıcı tanımlayıcısı</string>
+ <string name="pref_interface_title">Arayüz</string>
+ <string name="full_screen_title">Tam ekran</string>
+ <string name="full_screen_summary">Sürükleyici dolaşımı etkinleştir</string>
+ <string name="onehand_title">Tek Elle Gezinme</string>
+ <string name="onehand_summary">Kaydırmalar ve çabuk eylemlerle daha kolay web gezinmesi</string>
+</resources>
diff --git a/res/values-zh-rCN/cm_strings.xml b/res/values-zh-rCN/cm_strings.xml
index c6dbfc544..a59d3d63b 100644
--- a/res/values-zh-rCN/cm_strings.xml
+++ b/res/values-zh-rCN/cm_strings.xml
@@ -19,10 +19,15 @@
<string name="accessibility_button_homescreen">主屏幕</string>
<string name="contextmenu_openlink_incognito_newwindow">在新的隐身标签页中打开</string>
<string name="contextmenu_openlink_incognito_newwindow_background">在新的后台隐身标签页中打开</string>
- <string name="pref_content_ua">用户代理</string>
+ <string name="pref_content_ua">用户代理 (User agent)</string>
<string name="pref_interface_title">界面</string>
<string name="full_screen_title">全屏</string>
<string name="full_screen_summary">启用沉浸式导航</string>
<string name="onehand_title">单手导航</string>
<string name="onehand_summary">使用滑动和快速操作来更容易的浏览网页</string>
+ <string name="permission_not_granted_dialog_title">未授予权限</string>
+ <string name="permission_not_granted_dialog_message">未被授予写入外部存储的权限。无法下载。</string>
+ <string name="browser_error_title">浏览器错误</string>
+ <string name="dialog_dismiss">忽略</string>
+ <string name="error_permissions">应用没有运行所需的关键权限。请检查您的权限设置。</string>
</resources>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index e5f22acf8..321c33a65 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -39,4 +39,10 @@
<string name="onehand_title">OneHand Navigation</string>
<string name="onehand_summary">Easier web navigation with swipes and quick actions</string>
+ <!-- Permission check -->
+ <string name="permission_not_granted_dialog_title">Permission not granted</string>
+ <string name="permission_not_granted_dialog_message">The permission to write to external storage was not granted. Cannot download.</string>
+ <string name="browser_error_title">Browser error</string>
+ <string name="dialog_dismiss">Dismiss</string>
+ <string name="error_permissions">The app does not have critical permissions needed to run. Please check your permissions settings.</string>
</resources>
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 4166b1109..85af8af3b 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -17,12 +17,15 @@
package com.android.browser;
import android.app.Activity;
+import android.app.AlertDialog;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.PowerManager;
+import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.ActionMode;
import android.view.ContextMenu;
@@ -37,7 +40,8 @@ import android.view.Window;
import com.android.browser.stub.NullController;
import com.google.common.annotations.VisibleForTesting;
-public class BrowserActivity extends Activity {
+public class BrowserActivity extends Activity
+ implements ActivityCompat.OnRequestPermissionsResultCallback {
public static final String ACTION_SHOW_BOOKMARKS = "show_bookmarks";
public static final String ACTION_SHOW_BROWSER = "show_browser";
@@ -51,6 +55,8 @@ public class BrowserActivity extends Activity {
private ActivityController mController = NullController.INSTANCE;
+ public static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
+
@Override
public void onCreate(Bundle icicle) {
if (LOGV_ENABLED) {
@@ -304,4 +310,25 @@ public class BrowserActivity extends Activity {
super.dispatchGenericMotionEvent(ev);
}
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String[] permissions,
+ int[] grantResults) {
+ switch (requestCode) {
+ case PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE:
+ // If request is cancelled, the result array is empty
+ if (grantResults.length > 0 &&
+ grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+ DownloadHandler.checkPendingDownloads(this);
+ } else {
+ new AlertDialog.Builder(this)
+ .setTitle(R.string.permission_not_granted_dialog_title)
+ .setMessage(R.string.permission_not_granted_dialog_message)
+ .setPositiveButton(android.R.string.ok, null)
+ .show();
+ }
+ break;
+ }
+ }
+
}
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index f00698673..3382e3651 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -1617,6 +1617,10 @@ public class Controller
openTabToHomePage();
break;
+ case R.id.new_incognito_tab_menu_id:
+ openIncognitoTab();
+ break;
+
case R.id.close_other_tabs_id:
closeOtherTabs();
break;
diff --git a/src/com/android/browser/DownloadHandler.java b/src/com/android/browser/DownloadHandler.java
index 5fc5b79d5..37ab027d7 100755
--- a/src/com/android/browser/DownloadHandler.java
+++ b/src/com/android/browser/DownloadHandler.java
@@ -28,6 +28,8 @@ import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.net.WebAddress;
import android.os.Environment;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.CookieManager;
@@ -44,6 +46,46 @@ public class DownloadHandler {
private static final String LOGTAG = "DLHandler";
+ //Singleton to hold the information about any pending downloads
+ private static PendingDownloadBundle pendingDownloadBundle;
+
+ private static class PendingDownloadBundle {
+ String url;
+ String userAgent;
+ String contentDisposition;
+ String mimetype;
+ String referer;
+ boolean privateBrowsing;
+
+ public static PendingDownloadBundle create(String url, String userAgent,
+ String contentDisposition, String mimetype, String referer,
+ boolean privateBrowsing) {
+ PendingDownloadBundle pdb = new PendingDownloadBundle();
+ pdb.url = url;
+ pdb.userAgent = userAgent;
+ pdb.contentDisposition = contentDisposition;
+ pdb.mimetype = mimetype;
+ pdb.referer = referer;
+ pdb.privateBrowsing = privateBrowsing;
+ return pdb;
+ }
+ }
+
+ /**
+ * Check if there is any pending download and start the download automatically in case
+ * there is one.
+ * @param activity Activity requesting the download.
+ */
+ public static void checkPendingDownloads(Activity activity) {
+ if (pendingDownloadBundle != null) {
+ onDownloadStartNoStream(activity, pendingDownloadBundle.url,
+ pendingDownloadBundle.userAgent, pendingDownloadBundle.contentDisposition,
+ pendingDownloadBundle.mimetype, pendingDownloadBundle.referer,
+ pendingDownloadBundle.privateBrowsing);
+ pendingDownloadBundle = null;
+ }
+ }
+
/**
* Notify the host application a download should be done, or that
* the data should be streamed if a streaming viewer is available.
@@ -130,7 +172,7 @@ public class DownloadHandler {
/**
* Notify the host application a download should be done, even if there
- * is a streaming viewer available for thise type.
+ * is a streaming viewer available for this type.
* @param activity Activity requesting the download.
* @param url The full url to the content that should be downloaded
* @param userAgent User agent of the downloading application.
@@ -143,6 +185,26 @@ public class DownloadHandler {
String url, String userAgent, String contentDisposition,
String mimetype, String referer, boolean privateBrowsing) {
+ // Check permissions first when download will be start.
+ int permissionCheck = ContextCompat.checkSelfPermission(activity,
+ android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ if (permissionCheck == PackageManager.PERMISSION_GRANTED) {
+ onDownloadNoStreamImpl(activity, url, userAgent, contentDisposition,
+ mimetype, referer, privateBrowsing);
+ } else {
+ pendingDownloadBundle = PendingDownloadBundle.create(url, userAgent,
+ contentDisposition, mimetype, referer, privateBrowsing);
+ // Permission not granted, request it from the user
+ ActivityCompat.requestPermissions(activity,
+ new String[] {android.Manifest.permission.WRITE_EXTERNAL_STORAGE},
+ BrowserActivity.PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
+ }
+ }
+
+ private static void onDownloadNoStreamImpl(Activity activity,
+ String url, String userAgent, String contentDisposition,
+ String mimetype, String referer, boolean privateBrowsing) {
+
String filename = URLUtil.guessFileName(url,
contentDisposition, mimetype);
diff --git a/src/com/android/browser/PermissionsActivity.java b/src/com/android/browser/PermissionsActivity.java
new file mode 100644
index 000000000..68f2b19a2
--- /dev/null
+++ b/src/com/android/browser/PermissionsActivity.java
@@ -0,0 +1,143 @@
+package com.android.browser;
+
+import android.Manifest;
+import android.app.Activity;
+import android.app.Dialog;
+import android.app.AlertDialog;
+import android.app.KeyguardManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
+import android.content.pm.PackageManager;
+import android.preference.PreferenceManager;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.Window;
+import android.view.WindowManager;
+import com.android.browser.R;
+
+/**
+ * Activity that shows permissions request dialogs and handles lack of critical permissions.
+ */
+public class PermissionsActivity extends Activity {
+ private static final String TAG = "PermissionsActivity";
+
+ private static String PREF_HAS_SEEN_PERMISSIONS_DIALOGS = "pref_has_seen_permissions_dialogs";
+ private static int PERMISSION_REQUEST_CODE = 1;
+ private static int RESULT_CODE_OK = 1;
+ private static int RESULT_CODE_FAILED = 2;
+
+ private int mIndexPermissionRequestStorage;
+ private boolean mShouldRequestStoragePermission;
+ private int mNumPermissionsToRequest;
+ private boolean mFlagHasStoragePermission;
+ private SharedPreferences mPrefs;
+
+ /**
+ * Close activity when secure app passes lock screen or screen turns
+ * off.
+ */
+ private final BroadcastReceiver mShutdownReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Log.v(TAG, "received intent, finishing: " + intent.getAction());
+ finish();
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mNumPermissionsToRequest = 0;
+ checkPermissions();
+ }
+
+ private void checkPermissions() {
+ if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
+ != PackageManager.PERMISSION_GRANTED) {
+ mNumPermissionsToRequest++;
+ mShouldRequestStoragePermission = true;
+ } else {
+ mFlagHasStoragePermission = true;
+ }
+
+ if (mNumPermissionsToRequest != 0) {
+ if (!mPrefs.getBoolean(PREF_HAS_SEEN_PERMISSIONS_DIALOGS, false)) {
+ buildPermissionsRequest();
+ } else {
+ // Permissions dialog has already been shown
+ // and we're still missing permissions.
+ handlePermissionsFailure();
+ }
+ } else {
+ handlePermissionsSuccess();
+ }
+ }
+
+ private void buildPermissionsRequest() {
+ String[] permissionsToRequest = new String[mNumPermissionsToRequest];
+ int permissionsRequestIndex = 0;
+
+ if (mShouldRequestStoragePermission) {
+ permissionsToRequest[permissionsRequestIndex] = Manifest.permission.READ_EXTERNAL_STORAGE;
+ mIndexPermissionRequestStorage = permissionsRequestIndex;
+ permissionsRequestIndex++;
+ }
+
+ Log.v(TAG, "requestPermissions count: " + permissionsToRequest.length);
+ requestPermissions(permissionsToRequest, PERMISSION_REQUEST_CODE);
+ }
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String permissions[],
+ int[] grantResults) {
+ Log.v(TAG, "onPermissionsResult counts: " + permissions.length + ":" + grantResults.length);
+
+ if (mShouldRequestStoragePermission) {
+ if (grantResults.length > 0 && grantResults[mIndexPermissionRequestStorage] ==
+ PackageManager.PERMISSION_GRANTED) {
+ mFlagHasStoragePermission = true;
+ } else {
+ handlePermissionsFailure();
+ }
+ }
+
+ if (mFlagHasStoragePermission) {
+ handlePermissionsSuccess();
+ }
+ }
+
+ private void handlePermissionsSuccess() {
+ Editor edit = mPrefs.edit();
+ edit.putBoolean(PREF_HAS_SEEN_PERMISSIONS_DIALOGS, true);
+ edit.commit();
+
+ Intent intent = new Intent(this, BrowserActivity.class);
+ startActivity(intent);
+ finish();
+ }
+
+ private void handlePermissionsFailure() {
+ new AlertDialog.Builder(this).setTitle(getResources().getString(R.string.browser_error_title))
+ .setMessage(getResources().getString(R.string.error_permissions))
+ .setPositiveButton(getResources().getString(R.string.dialog_dismiss),
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ finish();
+ }
+ })
+ .show();
+ }
+}
diff --git a/src/com/android/browser/PermissionsPrompt.java b/src/com/android/browser/PermissionsPrompt.java
index 29412d9b3..47c6c4ef3 100644
--- a/src/com/android/browser/PermissionsPrompt.java
+++ b/src/com/android/browser/PermissionsPrompt.java
@@ -16,7 +16,11 @@
package com.android.browser;
+import android.Manifest;
+import android.app.Activity;
import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
import android.net.Uri;
import android.util.AttributeSet;
import android.view.Gravity;
@@ -29,7 +33,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
+import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.List;
import java.util.Vector;
public class PermissionsPrompt extends RelativeLayout {
@@ -37,14 +43,17 @@ public class PermissionsPrompt extends RelativeLayout {
private Button mAllowButton;
private Button mDenyButton;
private CheckBox mRemember;
+ private Context mContext;
private PermissionRequest mRequest;
public PermissionsPrompt(Context context) {
this(context, null);
+ mContext = context;
}
public PermissionsPrompt(Context context, AttributeSet attrs) {
super(context, attrs);
+ mContext = context;
}
@Override
@@ -117,9 +126,33 @@ public class PermissionsPrompt extends RelativeLayout {
*/
private void handleButtonClick(boolean allow) {
hide();
- if (allow)
- mRequest.grant(mRequest.getResources());
- else
+ if (allow) {
+ String[] resources = mRequest.getResources();
+ List<String> permissionsToRequest = new ArrayList<String>();
+
+ for (String resource : resources) {
+ if (resource.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE) &&
+ mContext.checkSelfPermission(Manifest.permission.CAMERA) !=
+ PackageManager.PERMISSION_GRANTED) {
+ permissionsToRequest.add(Manifest.permission.CAMERA);
+ } else if (resource.equals(PermissionRequest.RESOURCE_AUDIO_CAPTURE) &&
+ mContext.checkSelfPermission(Manifest.permission.RECORD_AUDIO) !=
+ PackageManager.PERMISSION_GRANTED) {
+ permissionsToRequest.add(Manifest.permission.RECORD_AUDIO);
+ }
+ }
+
+ if (permissionsToRequest.size() > 0) {
+ String[] permissions = permissionsToRequest.toArray(
+ new String[permissionsToRequest.size()]);
+ ((Activity) mContext).requestPermissions(permissions, 1);
+ Intent intent = new Intent(mContext, PermissionsActivity.class);
+ mContext.startActivity(intent);
+ } else {
+ mRequest.grant(mRequest.getResources());
+ }
+ } else {
mRequest.deny();
+ }
}
}
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index 6707134f7..d71d9ec84 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -184,10 +184,14 @@ public class PhoneUi extends BaseUi {
if (info != null) {
info.setVisible(false);
}
- MenuItem newtab = menu.findItem(R.id.new_tab_menu_id);
- if (newtab != null && !mUseQuickControls) {
- newtab.setVisible(false);
- }
+ MenuItem newTab = menu.findItem(R.id.new_tab_menu_id);
+ if (newTab != null && !mUseQuickControls) {
+ newTab.setVisible(false);
+ }
+ MenuItem newIncognitoTab = menu.findItem(R.id.new_incognito_tab_menu_id);
+ if (newIncognitoTab != null && !mUseQuickControls) {
+ newIncognitoTab.setVisible(false);
+ }
MenuItem closeOthers = menu.findItem(R.id.close_other_tabs_id);
if (closeOthers != null) {
boolean isLastTab = true;
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index ceacd4208..c99e9b214 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -23,6 +23,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
+import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
@@ -398,7 +399,7 @@ class Tab implements PictureListener {
syncCurrentState(view, url);
mWebViewController.onPageFinished(Tab.this);
- if (view.getUrl().equals(HomeProvider.MOST_VISITED_URL)) {
+ if (mCurrentState.mUrl.equals(HomeProvider.MOST_VISITED_URL)) {
if (!mInMostVisitedPage) {
loadUrl(HomeProvider.MOST_VISITED, null);
mInMostVisitedPage = true;