diff options
Diffstat (limited to 'chrome/android')
48 files changed, 0 insertions, 3339 deletions
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 99ecb178..ceef92f 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn @@ -221,245 +221,6 @@ java_cpp_template("resource_id_javagen") { ] } -# GYP: //chrome/chrome_shell.gypi:libchromeshell_base -group("chrome_shell_base") { - deps = [ - "//chrome/browser/ui", - "//chrome:chrome_android_core", - "//base", - "//base/allocator", - "//content/public/app:both", - "//skia", - ] - # TODO(GYP): - #[ 'order_profiling!=0', { - #'dependencies': [ '../tools/cygprofile/cygprofile.gyp:cygprofile', ], - #}], -} - -# GYP: //chrome/chrome_shell.gypi:libchromeshell -shared_library("chrome_shell") { - testonly = true - sources = [ - "shell/chrome_main_delegate_chrome_shell_android.cc", - "shell/chrome_main_delegate_chrome_shell_android.h", - "shell/chrome_shell_entry_point.cc", - ] - deps = [ - ":chrome_shell_base", - "//build/config/sanitizers:deps", - ] -} - -# GYP: N/A -android_resources("chrome_shell_resources") { - deps = [ - ":chrome_java_resources", - ] - testonly = true - resource_dirs = [ "shell/res" ] - custom_package = "org.chromium.chrome.shell" -} - -# GYP: N/A -android_library("chrome_shell_java") { - testonly = true - deps = [ - ":chrome_java", - ":chrome_java_resources", - ":chrome_shell_resources", - "//base:base_java", - "//content/public/android:content_java", - "//components/dom_distiller/android:dom_distiller_content_java", - "//components/dom_distiller/android:dom_distiller_core_java", - "//components/service_tab_launcher:service_tab_launcher_java", - "//components/web_contents_delegate_android:web_contents_delegate_android_java", - "//printing:printing_java", - "//net/android:net_java", - "//sync/android:sync_java", - "//third_party/android_tools:android_support_v13_java", - "//third_party/android_tools:android_support_v7_appcompat_java", - "//ui/android:ui_java", - ] - DEPRECATED_java_in_dir = "shell/java/src" -} - -chrome_shell_assets_dir = "$root_build_dir/chrome_shell/assets" - -# GYP: N/A -copy_ex("chrome_shell_assets") { - clear_dir = true - dest = chrome_shell_assets_dir - sources = [ - "$root_build_dir/chrome_100_percent.pak", - "$root_build_dir/locales/am.pak", - "$root_build_dir/locales/ar.pak", - "$root_build_dir/locales/bg.pak", - "$root_build_dir/locales/ca.pak", - "$root_build_dir/locales/cs.pak", - "$root_build_dir/locales/da.pak", - "$root_build_dir/locales/de.pak", - "$root_build_dir/locales/el.pak", - "$root_build_dir/locales/en-GB.pak", - "$root_build_dir/locales/en-US.pak", - "$root_build_dir/locales/es-419.pak", - "$root_build_dir/locales/es.pak", - "$root_build_dir/locales/fa.pak", - "$root_build_dir/locales/fi.pak", - "$root_build_dir/locales/fil.pak", - "$root_build_dir/locales/fr.pak", - "$root_build_dir/locales/he.pak", - "$root_build_dir/locales/hi.pak", - "$root_build_dir/locales/hr.pak", - "$root_build_dir/locales/hu.pak", - "$root_build_dir/locales/id.pak", - "$root_build_dir/locales/it.pak", - "$root_build_dir/locales/ja.pak", - "$root_build_dir/locales/ko.pak", - "$root_build_dir/locales/lt.pak", - "$root_build_dir/locales/lv.pak", - "$root_build_dir/locales/nb.pak", - "$root_build_dir/locales/nl.pak", - "$root_build_dir/locales/pl.pak", - "$root_build_dir/locales/pt-BR.pak", - "$root_build_dir/locales/pt-PT.pak", - "$root_build_dir/locales/ro.pak", - "$root_build_dir/locales/ru.pak", - "$root_build_dir/locales/sk.pak", - "$root_build_dir/locales/sl.pak", - "$root_build_dir/locales/sr.pak", - "$root_build_dir/locales/sv.pak", - "$root_build_dir/locales/sw.pak", - "$root_build_dir/locales/th.pak", - "$root_build_dir/locales/tr.pak", - "$root_build_dir/locales/uk.pak", - "$root_build_dir/locales/vi.pak", - "$root_build_dir/locales/zh-CN.pak", - "$root_build_dir/locales/zh-TW.pak", - "$root_build_dir/resources.pak", - ] - deps = [ - "//chrome:packed_resources", - "//chrome:packed_extra_resources", - ] - - if (icu_use_data_file) { - sources += [ "$root_build_dir/icudtl.dat" ] - deps += [ "//third_party/icu:icudata" ] - } - if (v8_use_external_startup_data) { - sources += [ - "$root_build_dir/natives_blob.bin", - "$root_build_dir/snapshot_blob.bin", - ] - deps += [ "//v8" ] - } -} - -chrome_shell_manifest = - "$target_gen_dir/chrome_shell_manifest/AndroidManifest.xml" - -# GYP: //chrome/chrome_shell.gypi:chrome_shell_manifest -jinja_template("chrome_shell_manifest") { - testonly = true - input = "shell/java/AndroidManifest.xml.jinja2" - output = chrome_shell_manifest -} - -# GYP: //chrome/chrome_shell.gypi:chrome_shell_apk -android_apk("chrome_shell_apk") { - testonly = true - deps = [ - ":chrome_shell", - ":chrome_shell_assets", - ":chrome_shell_java", - ":chrome_shell_manifest", - ":chrome_shell_resources", - "//base:base_java", - ] - apk_name = "ChromeShell" - android_manifest = chrome_shell_manifest - native_libs = [ "libchrome_shell.so" ] - native_lib_version_rule = "//build/util:chrome_version_json" - _native_lib_file = - rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir) - native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)" - asset_location = chrome_shell_assets_dir - - #TODO(GYP): - #'variables': { - #'conditions': [ - #['component != "shared_library" and target_arch != "arm64" and target_arch != "x64" and profiling_full_stack_frames != 1', { - ## Only enable the chromium linker on regular builds, since the - ## component build crashes on Android 4.4. See b/11379966 - #'use_chromium_linker': '1', - #}], - #], - #}, -} - -# GYP: part of //chrome/chrome_tests.gypi:chrome_shell_test_apk -android_library("chrome_javatests") { - testonly = true - DEPRECATED_java_in_dir = "javatests_shell/src" - deps = [ - ":chrome_java", - ":chrome_java_resources", - ":chrome_shell_java", - ":chrome_shell_resources", - ":chrome_shell_test_java", - "//base:base_java", - "//base:base_java_test_support", - "//chrome/test/android:chrome_java_test_support", - "//components/bookmarks/common/android:bookmarks_java", - "//components/dom_distiller/android:dom_distiller_core_java", - "//components/invalidation/impl:java", - "//components/navigation_interception/android:navigation_interception_java", - "//content/public/android:content_java", - "//content/public/test/android:content_java_test_support", - "//net/android:net_java_test_support", - "//sync/android:sync_java", - "//sync:sync_java_test_support", - "//third_party/android_protobuf:protobuf_nano_javalib", - "//third_party/android_tools:android_support_v13_java", - "//third_party/android_tools:android_support_v7_appcompat_java", - "//third_party/android_tools:legacy_http_javalib", - "//third_party/cacheinvalidation:cacheinvalidation_javalib", - "//third_party/cacheinvalidation:cacheinvalidation_proto_java", - "//third_party/jsr-305:jsr_305_javalib", - "//ui/android:ui_java", - ] -} - -android_library("chrome_shell_test_java") { - testonly = true - deps = [ - ":chrome_java", - ":chrome_shell_java", - "//base:base_java", - "//base:base_java_test_support", - "//chrome/test/android:chrome_java_test_support", - "//content/public/android:content_java", - "//content/public/test/android:content_java_test_support", - "//third_party/android_tools:android_support_v13_java", - "//third_party/android_tools:android_support_v7_appcompat_java", - "//ui/android:ui_java", - ] - DEPRECATED_java_in_dir = "shell/javatests/src" -} - -# GYP: //chrome/chrome_tests.gypi:chrome_shell_test_apk -instrumentation_test_apk("chrome_shell_test_apk") { - apk_under_test = ":chrome_shell_apk" - deps = [ - ":chrome_javatests", - ":chrome_shell_test_java", - ] - apk_name = "ChromeShellTest" - android_manifest = "shell/javatests/AndroidManifest.xml" - isolate_file = "../chrome_shell_test_apk.isolate" -} - # GYP: //chrome/chrome_tests.gypi:chrome_junit_tests junit_binary("chrome_junit_tests") { java_files = [ diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index c0b6ba5..c827efa 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd @@ -1081,9 +1081,6 @@ You are signing in with a managed account and giving its administrator control o <message name="IDS_ACCESSIBILITY_TABSTRIP_BTN_CLOSE_TAB" desc="Content description for the close tab button."> Close tab </message> - <message name="IDS_ACCESSIBILITY_TABSTRIP_BTN_NEW_TAB" desc="Content description for the new tab button."> - New tab - </message> <message name="IDS_TAB_LOADING_DEFAULT_TITLE" desc="The title of a tab when we are still waiting for either the URL or the real title. This generally shows when the page is first loading."> Loading… </message> @@ -1177,9 +1174,6 @@ You are signing in with a managed account and giving its administrator control o <message name="IDS_ACCESSIBILITY_MENU_FORWARD" desc="Content description for the forward navigation button."> Go forward </message> - <message name="IDS_ACCESSIBILITY_MENU_BACK" desc="Content description for the backard navigation button."> - Go back - </message> <message name="IDS_ACCESSIBILITY_MENU_INFO" desc="Content description for the button which opens the page info popup, which displays security information and permissions for the current page"> View site information </message> diff --git a/chrome/android/javatests_shell/DEPS b/chrome/android/javatests_shell/DEPS deleted file mode 100644 index fc12375..0000000 --- a/chrome/android/javatests_shell/DEPS +++ /dev/null @@ -1,11 +0,0 @@ -include_rules = [ - "+components/bookmarks/common/android/java/src/org/chromium/components/bookmarks", - "+components/dom_distiller/android/java/src/org/chromium/components/dom_distiller/core", - "+components/navigation_interception", - "+components/precache/android/javatests", - "+content/public/android/java", - "+sync/android/java/src/org/chromium/sync", - # We should only depend on the util package of something that lives in - # javatests. - "+sync/test/android/javatests/src/org/chromium/sync/test/util", -] diff --git a/chrome/android/javatests_shell/OWNERS b/chrome/android/javatests_shell/OWNERS deleted file mode 100644 index a1e5746..0000000 --- a/chrome/android/javatests_shell/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -dfalcantara@chromium.org -dtrainor@chromium.org -miguelg@chromium.org -nyquist@chromium.org -skyostil@chromium.org -tedchoc@chromium.org -yfriedman@chromium.org diff --git a/chrome/android/javatests_shell/src/org/chromium/chrome/browser/DummyTest.java b/chrome/android/javatests_shell/src/org/chromium/chrome/browser/DummyTest.java deleted file mode 100644 index 6fce64b..0000000 --- a/chrome/android/javatests_shell/src/org/chromium/chrome/browser/DummyTest.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser; - -import android.test.InstrumentationTestCase; -import android.test.suitebuilder.annotation.SmallTest; - -/** - * This test exists so that ChromeShellTest.apk can compile. This can be deleted imminently when - * ChromeShellTest is deleted. - */ -public class DummyTest extends InstrumentationTestCase { - - @SmallTest - public void testNothing() {} - -} diff --git a/chrome/android/shell/DEPS b/chrome/android/shell/DEPS deleted file mode 100644 index 271e5e5..0000000 --- a/chrome/android/shell/DEPS +++ /dev/null @@ -1,13 +0,0 @@ -include_rules = [ - "+chrome/app", - "+chrome/browser", - "+components/dom_distiller/android/java", - "+components/search_engines", - "+content/public/android", - "+content/public/browser", - "+content/public/browser/android", - "+printing/android", - "+sync/android/java/src/org/chromium/sync/notifier", - "+sync/android/java/src/org/chromium/sync/signin", -] - diff --git a/chrome/android/shell/chrome_main_delegate_chrome_shell_android.cc b/chrome/android/shell/chrome_main_delegate_chrome_shell_android.cc deleted file mode 100644 index 76125e6..0000000 --- a/chrome/android/shell/chrome_main_delegate_chrome_shell_android.cc +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/android/shell/chrome_main_delegate_chrome_shell_android.h" - -#include "base/android/jni_android.h" -#include "base/android/jni_registrar.h" - -ChromeMainDelegateAndroid* ChromeMainDelegateAndroid::Create() { - return new ChromeMainDelegateChromeShellAndroid(); -} - -ChromeMainDelegateChromeShellAndroid::ChromeMainDelegateChromeShellAndroid() { -} - -ChromeMainDelegateChromeShellAndroid::~ChromeMainDelegateChromeShellAndroid() { -} - -bool ChromeMainDelegateChromeShellAndroid::BasicStartupComplete( - int* exit_code) { - return ChromeMainDelegateAndroid::BasicStartupComplete(exit_code); -} - diff --git a/chrome/android/shell/chrome_main_delegate_chrome_shell_android.h b/chrome/android/shell/chrome_main_delegate_chrome_shell_android.h deleted file mode 100644 index a4ee791..0000000 --- a/chrome/android/shell/chrome_main_delegate_chrome_shell_android.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_ANDROID_SHELL_CHROME_MAIN_DELEGATE_CHROME_SHELL_ANDROID_H_ -#define CHROME_ANDROID_SHELL_CHROME_MAIN_DELEGATE_CHROME_SHELL_ANDROID_H_ - -#include "chrome/app/android/chrome_main_delegate_android.h" - -class ChromeMainDelegateChromeShellAndroid : public ChromeMainDelegateAndroid { - public: - ChromeMainDelegateChromeShellAndroid(); - ~ChromeMainDelegateChromeShellAndroid() override; - - bool BasicStartupComplete(int* exit_code) override; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegateChromeShellAndroid); -}; - -#endif // CHROME_ANDROID_SHELL_CHROME_MAIN_DELEGATE_CHROME_SHELL_ANDROID_H_ diff --git a/chrome/android/shell/chrome_shell_entry_point.cc b/chrome/android/shell/chrome_shell_entry_point.cc deleted file mode 100644 index 4388032..0000000 --- a/chrome/android/shell/chrome_shell_entry_point.cc +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/jni_android.h" -#include "base/bind.h" -#include "chrome/app/android/chrome_jni_onload.h" - -namespace { - -bool RegisterJNI(JNIEnv* env) { - return true; -} - -bool Init() { - return true; -} - -} // namespace - -// This is called by the VM when the shared library is first loaded, -// and used by chrome_shell and chrome_sync_shell. -JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { - if (!chrome::android::OnJNIOnLoadRegisterJNI(vm, base::Bind(&RegisterJNI)) || - !chrome::android::OnJNIOnLoadInit(base::Bind(&Init))) { - return -1; - } - return JNI_VERSION_1_4; -} diff --git a/chrome/android/shell/java/AndroidManifest.xml.jinja2 b/chrome/android/shell/java/AndroidManifest.xml.jinja2 deleted file mode 100644 index babbee6..0000000 --- a/chrome/android/shell/java/AndroidManifest.xml.jinja2 +++ /dev/null @@ -1,248 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Copyright 2014 The Chromium Authors. All rights reserved. - - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - --> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.chromium.chrome.shell"> - - <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" /> - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> - <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> - <uses-permission android:name="android.permission.BLUETOOTH"/> - <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> - <uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/> - <uses-permission android:name="android.permission.CAMERA" /> - <uses-permission android:name="android.permission.GET_ACCOUNTS"/> - <uses-permission android:name="android.permission.INTERNET"/> - <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> - <uses-permission android:name="android.permission.NFC"/> - <uses-permission android:name="android.permission.RECORD_AUDIO"/> - <uses-permission android:name="android.permission.VIBRATE"/> - <uses-permission android:name="android.permission.WAKE_LOCK"/> - <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/> - <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /> - <uses-permission android:name="android.permission.USE_CREDENTIALS" /> - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> - <!-- Only Chrome can receive the messages and registration result for GCM --> - <permission android:name="org.chromium.chrome.shell.permission.C2D_MESSAGE" - android:protectionLevel="signature" /> - <uses-permission android:name="org.chromium.chrome.shell.permission.C2D_MESSAGE" /> - <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> - - <permission android:name="org.chromium.chrome.shell.permission.DEBUG" - android:label="Debug web pages in Chrome Shell" - android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" - android:protectionLevel="signature" /> - - <application android:name="org.chromium.chrome.shell.ChromeShellApplication" - android:icon="@mipmap/app_icon" - android:label="@string/app_name" - android:supportsRtl="true"> - <activity android:name="org.chromium.chrome.shell.ChromeShellActivity" - android:launchMode="singleTask" - android:theme="@style/MainTheme" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize" - android:hardwareAccelerated="true"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" /> - </intent-filter> - </activity> - <activity android:name="org.chromium.sync.test.util.MockGrantCredentialsPermissionActivity" - android:exported="true"> - <intent-filter> - <action android:name="android.intent.action.VIEW" /> - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - </activity> - <activity android:theme="@style/PreferencesTheme" - android:name="org.chromium.chrome.shell.preferences.ChromeShellPreferences" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize" - android:label="@string/preferences" - android:exported="false"> - </activity> - <activity android:name="org.chromium.chrome.browser.sync.ui.PassphraseActivity" - android:theme="@style/PreferencesTheme"> - </activity> - - <!-- The following service entries exist in order to allow us to - start more than one sandboxed process. --> - - <!-- NOTE: If you change the value of "android:process" for the below services, - you also need to update kHelperProcessExecutableName in chrome_constants.cc. --> - {% set num_sandboxed_services = 20 %} - <meta-data android:name="org.chromium.content.browser.NUM_SANDBOXED_SERVICES" - android:value="{{ num_sandboxed_services }}"/> - {% for i in range(num_sandboxed_services) %} - <service android:name="org.chromium.content.app.SandboxedProcessService{{ i }}" - android:process=":sandboxed_process{{ i }}" - android:isolatedProcess="true" - android:exported="false" /> - {% endfor %} - - {% set num_privileged_services = 3 %} - <meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES" - android:value="{{ num_privileged_services }}"/> - {% for i in range(num_privileged_services) %} - <service android:name="org.chromium.content.app.PrivilegedProcessService{{ i }}" - android:process=":privileged_process{{ i }}" - android:isolatedProcess="false" - android:exported="false" /> - {% endfor %} - - <!-- Receiver for GCM messages. Rebroadcasts them locally for sync. --> - <receiver android:exported="true" - android:name="com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener$GCMReceiver" - android:permission="com.google.android.c2dm.permission.SEND"> - <intent-filter> - <action android:name="com.google.android.c2dm.intent.RECEIVE" /> - <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> - <category android:name="org.chromium.chrome.shell"/> - </intent-filter> - </receiver> - <service android:exported="false" - android:name="com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener"> - <meta-data android:name="sender_ids" - android:value="cloudprint.c2dm@gmail.com,ipc.invalidation@gmail.com"/> - </service> - - <!-- Notification service for sync. --> - <meta-data android:name="ipc.invalidation.ticl.listener_service_class" - android:value="org.chromium.components.invalidation.InvalidationClientService"/> - <service android:name="org.chromium.components.invalidation.InvalidationClientService" - android:exported="false"> - <intent-filter> - <action android:name="com.google.ipc.invalidation.AUTH_TOKEN_REQUEST"/> - </intent-filter> - </service> - <service android:exported="false" - android:name="com.google.ipc.invalidation.ticl.android2.TiclService"/> - <service android:exported="false" - android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageSenderService"/> - <receiver android:exported="false" - android:name="com.google.ipc.invalidation.ticl.android2.AndroidInternalScheduler$AlarmReceiver"/> - <receiver android:exported="false" - android:name="com.google.ipc.invalidation.external.client.contrib.AndroidListener$AlarmReceiver"/> - - <!-- Notification service multiplexed GCM receiver --> - <service android:exported="false" - android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageReceiverService" - android:enabled="true"/> - <receiver android:exported="false" - android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageReceiverService$Receiver"> - <intent-filter> - <action android:name="com.google.ipc.invalidation.gcmmplex.EVENT" /> - </intent-filter> - </receiver> - - <!-- GCMDriver multiplexed GCM receiver --> - <service android:exported="false" - android:name="org.chromium.chrome.browser.services.gcm.GCMListener"/> - <receiver android:exported="false" - android:name="org.chromium.chrome.browser.services.gcm.GCMListener$Receiver"> - <intent-filter> - <action android:name="com.google.ipc.invalidation.gcmmplex.EVENT" /> - </intent-filter> - </receiver> - - <!-- Android Notification service listener --> - <service android:exported="false" - android:name="org.chromium.chrome.browser.notifications.NotificationService"/> - <receiver android:exported="false" - android:name="org.chromium.chrome.browser.notifications.NotificationService$Receiver"> - <intent-filter> - <action android:name="org.chromium.chrome.browser.notifications.CLICK_NOTIFICATION" /> - <action android:name="org.chromium.chrome.browser.notifications.CLOSE_NOTIFICATION" /> - </intent-filter> - </receiver> - - <!-- Service Worker Background Sync service listener --> - <service android:name="org.chromium.content.browser.BackgroundSyncLauncherService" - android:exported="false" /> - <receiver android:name="org.chromium.content.browser.BackgroundSyncLauncherService$Receiver"> - <intent-filter> - <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> - </intent-filter> - </receiver> - - <provider android:name="org.chromium.chrome.browser.ChromeBrowserProvider" - android:authorities="org.chromium.chrome.shell" - android:exported="true" /> - - <!-- Provider for FileProvider. --> - <provider android:name="android.support.v4.content.FileProvider" - android:authorities="org.chromium.chrome.shell.FileProvider" - android:exported="false" - android:grantUriPermissions="true"> - <meta-data android:name="android.support.FILE_PROVIDER_PATHS" - android:resource="@xml/file_paths" /> - </provider> - - <!-- Sync adapter for browser invalidation. --> - <service android:exported="false" - android:name="org.chromium.chrome.shell.invalidation.ChromeShellSyncAdapterService"> - <intent-filter> - <action android:name="android.content.SyncAdapter" /> - </intent-filter> - <meta-data android:name="android.content.SyncAdapter" - android:resource="@xml/syncadapter" /> - </service> - - <!-- Broadcast receiver that will be notified of account changes. --> - <receiver android:name="org.chromium.chrome.shell.signin.AccountsChangedReceiver"> - <intent-filter> - <action android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" /> - </intent-filter> - </receiver> - - <meta-data android:name="org.chromium.content.browser.SMART_CLIP_PROVIDER" - android:value="org.chromium.content.browser.SmartClipProvider" /> - <meta-data android:name="org.chromium.components.service_tab_launcher.SERVICE_TAB_LAUNCHER" - android:value="org.chromium.chrome.shell.ChromeShellServiceTabLauncher" /> - - <!-- Precache service. --> - <service android:name="org.chromium.chrome.browser.precache.PrecacheService" - android:exported="false" /> - <receiver android:name="org.chromium.chrome.browser.precache.PrecacheServiceLauncher"> - <intent-filter> - <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/> - <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/> - <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> - </intent-filter> - </receiver> - - <!-- Service for the media playback control notification --> - <service android:name="org.chromium.chrome.browser.media.ui.NotificationMediaPlaybackControl$ListenerService" - android:exported="false" /> - - <!-- Activity, service, and meta-data to support casting to Chromecast --> - - <!-- Expanded controller activity is displayed when the Cast Notification is clicked --> - <activity android:name="org.chromium.chrome.browser.media.remote.ExpandedControllerActivity" - android:theme="@style/MainTheme" - android:label="Chrome.ExpandedControllerActivity" - android:hardwareAccelerated="true" - android:launchMode="singleTask" - android:noHistory="true" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize" - android:excludeFromRecents="true"> - </activity> - - <service android:name="org.chromium.chrome.browser.media.remote.NotificationTransportControl$ListenerService" /> - - <!-- Media route controllers to use for remote playback (cast). - This is here, rather than in code, since it varies between upstream and downstream, - yet we need this list of classes in the notification service, which belongs upstream - and doesn't run the downstream Clank startup code. The Cast code will, for each media element, - choose the first MediaRouteController that can play it, so the order of the list can be important. - The most specific MediaRouteControllers should be listed first, followed by more generic ones --> - <meta-data android:name="org.chromium.content.browser.REMOTE_MEDIA_PLAYERS" - android:value="org.chromium.chrome.browser.media.remote.DefaultMediaRouteController"/> - </application> -</manifest> diff --git a/chrome/android/shell/java/DEPS b/chrome/android/shell/java/DEPS deleted file mode 100644 index 224b2de5..0000000 --- a/chrome/android/shell/java/DEPS +++ /dev/null @@ -1,4 +0,0 @@ -include_rules = [ - "+components/service_tab_launcher", - "+content/public/android/java", -] diff --git a/chrome/android/shell/java/proguard.flags b/chrome/android/shell/java/proguard.flags deleted file mode 100644 index 1228939..0000000 --- a/chrome/android/shell/java/proguard.flags +++ /dev/null @@ -1,77 +0,0 @@ -# Keep line number information, useful for stack traces. --keepattributes SourceFile,LineNumberTable - -# Keep all runtime visible annotations --keepattributes RuntimeVisibleAnnotations - -# Keep the annotations. --keep @interface *** - -# A lot of code in org.chromium is used by both the internal Chrome code and by -# ChromeShell tests. It doesn't make sense to mark such things as -# @VisibleForTesting. For now, just keep everything in org.chromium. --keep class org.chromium.** { - *; -} - -# Keep code annotated with the following annotations. --keep class * { - @**.AccessedByNative <fields>; - @**.CalledByNative <methods>; - @**.CalledByNativeUnchecked <methods>; - @**.JavascriptInterface <methods>; - @**.NativeCall <methods>; - @**.UsedByReflection <methods>; - @**.VisibleForTesting *; - native <methods>; -} - -# Keep the client interfaces for cacheinvalidation as they are used as -# argument types for some of our code that we're keeping and proguard warns -# otherwise. --keep class com.google.ipc.invalidation.external.client.** { - *; -} --keep class com.google.protos.ipc.invalidation.** { - *; -} - -# Keep all enum values and valueOf methods. See -# http://proguard.sourceforge.net/index.html#manual/examples.html -# for the reason for this. Also, see http://crbug.com/248037. --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Keep all Parcelables as they might be marshalled outside Chrome. --keep class * implements android.os.Parcelable { - public static final ** CREATOR; -} - -# SearchView is used in website_preferences_menu.xml and is constructed by -# Android using reflection. --keep class android.support.v7.widget.SearchView { - public <init>(...); -} - --keep class android.support.v7.app.AlertDialog { - public ** getButton(int); -} - -# Google Play Services warnings are about its resources. --dontwarn com.google.android.gms.R** - -# TODO(yfriedman): Remove when crbug.com/488192 is fixed. --dontwarn org.apache.http.** - -# The support library contains references to newer platform versions. -# Don't warn about those in case this app is linking against an older -# platform version. We know about them, and they are safe. --dontwarn android.support.** - --dontwarn javax.annotation.Nullable - -# TODO(aurimas): remove this when Google Play Services no longer uses setLatestEventInfo call -# that was deprecated in Android M. It is save to suppress this according to b/18510449. --dontwarn android.app.Notification diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java deleted file mode 100644 index 75feed0..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import android.app.Activity; -import android.app.FragmentManager; -import android.app.Notification; -import android.content.Intent; -import android.os.Bundle; -import android.provider.Browser; -import android.support.v7.app.AppCompatActivity; -import android.text.TextUtils; -import android.util.Log; -import android.view.KeyEvent; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; - -import org.chromium.base.ApiCompatibilityUtils; -import org.chromium.base.BaseSwitches; -import org.chromium.base.CommandLine; -import org.chromium.base.ContentUriUtils; -import org.chromium.base.MemoryPressureListener; -import org.chromium.base.VisibleForTesting; -import org.chromium.base.annotations.SuppressFBWarnings; -import org.chromium.base.library_loader.LibraryProcessType; -import org.chromium.base.library_loader.ProcessInitException; -import org.chromium.chrome.browser.DevToolsServer; -import org.chromium.chrome.browser.FileProviderHelper; -import org.chromium.chrome.browser.WarmupManager; -import org.chromium.chrome.browser.WebsiteSettingsPopup; -import org.chromium.chrome.browser.appmenu.AppMenuHandler; -import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate; -import org.chromium.chrome.browser.dom_distiller.DomDistillerTabUtils; -import org.chromium.chrome.browser.nfc.BeamController; -import org.chromium.chrome.browser.nfc.BeamProvider; -import org.chromium.chrome.browser.notifications.NotificationUIManager; -import org.chromium.chrome.browser.preferences.PreferencesLauncher; -import org.chromium.chrome.browser.printing.PrintingControllerFactory; -import org.chromium.chrome.browser.printing.TabPrinter; -import org.chromium.chrome.browser.share.ShareHelper; -import org.chromium.chrome.browser.sync.SyncController; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; -import org.chromium.chrome.browser.tabmodel.TabModelSelector; -import org.chromium.chrome.shell.signin.AccountChooserFragment; -import org.chromium.chrome.shell.signin.SignoutFragment; -import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; -import org.chromium.components.service_tab_launcher.ServiceTabLauncher; -import org.chromium.content.app.ContentApplication; -import org.chromium.content.browser.ActivityContentVideoViewClient; -import org.chromium.content.browser.BrowserStartupController; -import org.chromium.content.browser.ContentViewCore; -import org.chromium.content.browser.DeviceUtils; -import org.chromium.printing.PrintManagerDelegateImpl; -import org.chromium.printing.PrintingController; -import org.chromium.sync.signin.AccountManagerHelper; -import org.chromium.sync.signin.ChromeSigninController; -import org.chromium.ui.base.ActivityWindowAndroid; -import org.chromium.ui.base.WindowAndroid; -import org.chromium.ui.widget.Toast; - -/** - * The {@link android.app.Activity} component of a basic test shell to test Chrome features. - */ -public class ChromeShellActivity extends AppCompatActivity implements AppMenuPropertiesDelegate { - private static final String TAG = "ChromeShellActivity"; - - /** - * Factory used to set up a mock ActivityWindowAndroid for testing. - */ - public interface ActivityWindowAndroidFactory { - /** - * @return ActivityWindowAndroid for the given activity. - */ - public ActivityWindowAndroid getActivityWindowAndroid(Activity activity); - } - - private static ActivityWindowAndroidFactory sWindowAndroidFactory = - new ActivityWindowAndroidFactory() { - @Override - public ActivityWindowAndroid getActivityWindowAndroid(Activity activity) { - final boolean listenToActivityState = true; - return new ActivityWindowAndroid(activity, listenToActivityState); - } - }; - - private ActivityWindowAndroid mWindow; - private TabManager mTabManager; - private ChromeShellToolbar mToolbar; - private DevToolsServer mDevToolsServer; - private SyncController mSyncController; - private PrintingController mPrintingController; - - /** - * Factory used to set up a mock AppMenuHandler for testing. - */ - public interface AppMenuHandlerFactory { - /** - * @return AppMenuHandler for the given activity and menu resource id. - */ - public AppMenuHandler getAppMenuHandler(Activity activity, - AppMenuPropertiesDelegate delegate, int menuResourceId); - } - - private AppMenuHandler mAppMenuHandler; - - @Override - @SuppressFBWarnings("DM_EXIT") - protected void onCreate(final Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - ContentApplication.initCommandLine(this); - waitForDebuggerIfNeeded(); - - DeviceUtils.addDeviceSpecificUserAgentSwitch(this); - - String url = getUrlFromIntent(getIntent()); - if (url != null) { - WarmupManager.getInstance().maybePrefetchDnsForUrlInBackground(this, url); - } - - BrowserStartupController.StartupCallback callback = - new BrowserStartupController.StartupCallback() { - @Override - public void onSuccess(boolean alreadyStarted) { - finishInitialization(savedInstanceState); - } - - @Override - public void onFailure() { - Toast.makeText(ChromeShellActivity.this, - R.string.browser_process_initialization_failed, - Toast.LENGTH_SHORT).show(); - Log.e(TAG, "Chromium browser process initialization failed"); - finish(); - } - }; - try { - BrowserStartupController.get(this, LibraryProcessType.PROCESS_BROWSER) - .startBrowserProcessesAsync(callback); - } catch (ProcessInitException e) { - Log.e(TAG, "Unable to load native library.", e); - System.exit(-1); - } - } - - private void finishInitialization(final Bundle savedInstanceState) { - setContentView(R.layout.chrome_shell_activity); - mTabManager = (TabManager) findViewById(R.id.tab_manager); - - mWindow = sWindowAndroidFactory.getActivityWindowAndroid(this); - mWindow.restoreInstanceState(savedInstanceState); - mTabManager.initialize(mWindow, new ActivityContentVideoViewClient(this) { - @Override - public void enterFullscreenVideo(View view) { - super.enterFullscreenVideo(view); - if (mTabManager != null) { - mTabManager.setOverlayVideoMode(true); - } - } - - @Override - public void exitFullscreenVideo() { - super.exitFullscreenVideo(); - if (mTabManager != null) { - mTabManager.setOverlayVideoMode(false); - } - } - }); - // Set up the animation placeholder to be the SurfaceView. This disables the - // SurfaceView's 'hole' clipping during animations that are notified to the window. - mWindow.setAnimationPlaceholderView( - mTabManager.getContentViewRenderView().getSurfaceView()); - - String startupUrl = getUrlFromIntent(getIntent()); - if (!TextUtils.isEmpty(startupUrl)) { - mTabManager.setStartupUrl(startupUrl); - } - mToolbar = (ChromeShellToolbar) findViewById(R.id.toolbar); - mAppMenuHandler = new AppMenuHandler(this, this, R.menu.chrome_shell_main_menu); - mToolbar.setMenuHandler(mAppMenuHandler); - - mDevToolsServer = new DevToolsServer("chrome_shell"); - mDevToolsServer.setRemoteDebuggingEnabled( - true, DevToolsServer.Security.ALLOW_DEBUG_PERMISSION); - - mPrintingController = PrintingControllerFactory.create(this); - - mSyncController = SyncController.get(this); - // In case this method is called after the first onStart(), we need to inform the - // SyncController that we have started. - mSyncController.updateSyncStateFromAndroid(); - ContentUriUtils.setFileProviderUtil(new FileProviderHelper()); - - BeamController.registerForBeam(this, new BeamProvider() { - @Override - public String getTabUrlForBeam() { - ChromeShellTab tab = getActiveTab(); - if (tab == null) return null; - return tab.getUrl(); - } - }); - - // The notification settings cog on the flipped side of Notifications and in the Android - // Settings "App Notifications" view will open us with a specific category. - if (getIntent().hasCategory(Notification.INTENT_CATEGORY_NOTIFICATION_PREFERENCES)) { - NotificationUIManager.launchNotificationPreferences(this, getIntent()); - } - } - - @Override - protected void onDestroy() { - super.onDestroy(); - - if (mDevToolsServer != null) mDevToolsServer.destroy(); - mDevToolsServer = null; - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - // TODO(dtrainor): Save/restore the tab state. - if (mWindow != null) mWindow.saveInstanceState(outState); - } - - @Override - public boolean onKeyUp(int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_BACK) { - if (mTabManager.isTabSwitcherVisible()) { - mTabManager.hideTabSwitcher(); - return true; - } - ChromeShellTab tab = getActiveTab(); - if (tab != null && tab.canGoBack()) { - tab.goBack(); - return true; - } - } - return super.onKeyUp(keyCode, event); - } - - @Override - protected void onNewIntent(Intent intent) { - if (MemoryPressureListener.handleDebugIntent(this, intent.getAction())) return; - - String url = getUrlFromIntent(intent); - if (TextUtils.isEmpty(url)) return; - - if (intent.getBooleanExtra(Browser.EXTRA_CREATE_NEW_TAB, false)) { - if (mTabManager == null) return; - - Tab newTab = mTabManager.createTab(url, TabLaunchType.FROM_LINK); - if (newTab != null && intent.hasExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA)) { - ServiceTabLauncher.onWebContentsForRequestAvailable( - intent.getIntExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA, 0), - newTab.getWebContents()); - } - - return; - } - - ChromeShellTab tab = getActiveTab(); - if (tab != null) tab.loadUrlWithSanitization(url); - } - - @Override - protected void onStop() { - super.onStop(); - - if (mToolbar != null) mToolbar.hideSuggestions(); - } - - @Override - protected void onStart() { - super.onStart(); - - Tab activeTab = getActiveTab(); - if (activeTab != null) activeTab.onActivityStart(); - - if (mSyncController != null) { - mSyncController.updateSyncStateFromAndroid(); - } - } - - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { - mWindow.onActivityResult(requestCode, resultCode, data); - } - - /** - * @return The {@link WindowAndroid} associated with this activity. - */ - public WindowAndroid getWindowAndroid() { - return mWindow; - } - - /** - * @return The {@link ChromeShellTab} that is currently visible. - */ - public ChromeShellTab getActiveTab() { - return mTabManager != null ? mTabManager.getCurrentTab() : null; - } - - /** - * @return The ContentViewCore of the active tab. - */ - public ContentViewCore getActiveContentViewCore() { - ChromeShellTab tab = getActiveTab(); - return tab != null ? tab.getContentViewCore() : null; - } - - /** - * Creates a {@link ChromeShellTab} with a URL specified by {@code url}. - * - * @param url The URL the new {@link ChromeShellTab} should start with. - */ - @VisibleForTesting - public void createTab(String url) { - mTabManager.createTab(url, TabLaunchType.FROM_EXTERNAL_APP); - } - - /** - * Closes all current tabs. - */ - public void closeAllTabs() { - mTabManager.closeAllTabs(); - } - - @VisibleForTesting - public void closeTab() { - mTabManager.closeTab(); - } - - /** - * Override the menu key event to show AppMenu. - */ - @Override - public boolean onKeyDown(int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) { - if (mToolbar != null) mToolbar.hideSuggestions(); - mAppMenuHandler.showAppMenu(findViewById(R.id.menu_button), false); - return true; - } - return super.onKeyDown(keyCode, event); - } - - @SuppressWarnings("deprecation") - @Override - public boolean onOptionsItemSelected(MenuItem item) { - ChromeShellTab activeTab = getActiveTab(); - if (activeTab != null) { - ViewGroup containerView = activeTab.getContentViewCore().getContainerView(); - if (containerView.isFocusable() && containerView.isFocusableInTouchMode()) { - containerView.requestFocus(); - } - } - int id = item.getItemId(); - if (id == R.id.signin) { - if (ChromeSigninController.get(this).isSignedIn()) { - openSignOutDialog(getFragmentManager()); - } else if (AccountManagerHelper.get(this).hasGoogleAccounts()) { - openSigninDialog(getFragmentManager()); - } else { - Toast.makeText(this, R.string.signin_no_account, Toast.LENGTH_SHORT).show(); - } - return true; - } else if (id == R.id.print) { - if (activeTab != null) { - mPrintingController.startPrint(new TabPrinter(activeTab), - new PrintManagerDelegateImpl(this)); - } - return true; - } else if (id == R.id.distill_page) { - if (activeTab != null) { - DomDistillerTabUtils.distillCurrentPageAndView( - activeTab.getContentViewCore().getWebContents()); - } - return true; - } else if (id == R.id.back_menu_id) { - if (activeTab != null && activeTab.canGoBack()) { - activeTab.goBack(); - } - return true; - } else if (id == R.id.forward_menu_id) { - if (activeTab != null && activeTab.canGoForward()) { - activeTab.goForward(); - } - return true; - } else if (id == R.id.info_menu_id) { - WebsiteSettingsPopup.show(this, activeTab.getProfile(), activeTab.getWebContents()); - return true; - } else if (id == R.id.new_tab_menu_id) { - mTabManager.createNewTab(); - return true; - } else if (id == R.id.share_menu_id || id == R.id.direct_share_menu_id) { - ShareHelper.share(item.getItemId() == R.id.direct_share_menu_id, this, - activeTab.getTitle(), activeTab.getUrl(), null); - return true; - } else if (id == R.id.preferences) { - PreferencesLauncher.launchSettingsPage(this, null); - return true; - } else { - return super.onOptionsItemSelected(item); - } - } - - private void waitForDebuggerIfNeeded() { - if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUGGER)) { - Log.e(TAG, "Waiting for Java debugger to connect..."); - android.os.Debug.waitForDebugger(); - Log.e(TAG, "Java debugger connected. Resuming execution."); - } - } - - private static String getUrlFromIntent(Intent intent) { - return intent != null ? intent.getDataString() : null; - } - - @Override - public boolean shouldShowAppMenu() { - return true; - } - - @Override - public int getFooterResourceId() { - return 0; - } - - @Override - public void prepareMenu(Menu menu) { - menu.setGroupVisible(R.id.MAIN_MENU, true); - ChromeShellTab activeTab = getActiveTab(); - - // Disable the "Back" menu item if there is no page to go to. - MenuItem backMenuItem = menu.findItem(R.id.back_menu_id); - backMenuItem.setEnabled(activeTab != null ? activeTab.canGoBack() : false); - - // Disable the "Forward" menu item if there is no page to go to. - MenuItem forwardMenuItem = menu.findItem(R.id.forward_menu_id); - forwardMenuItem.setEnabled(activeTab != null ? activeTab.canGoForward() : false); - - // ChromeShell does not know about bookmarks yet - menu.findItem(R.id.bookmark_this_page_id).setEnabled(true); - - MenuItem signinItem = menu.findItem(R.id.signin); - if (ChromeSigninController.get(this).isSignedIn()) { - signinItem.setTitle(ChromeSigninController.get(this).getSignedInAccountName()); - } else { - signinItem.setTitle(R.string.signin_sign_in); - } - - menu.findItem(R.id.print).setVisible(ApiCompatibilityUtils.isPrintingSupported()); - - MenuItem distillPageItem = menu.findItem(R.id.distill_page); - if (CommandLine.getInstance().hasSwitch(ChromeShellSwitches.ENABLE_DOM_DISTILLER)) { - String url = activeTab != null ? activeTab.getUrl() : null; - distillPageItem.setEnabled(!DomDistillerUrlUtils.isDistilledPage(url)); - distillPageItem.setVisible(true); - } else { - distillPageItem.setVisible(false); - } - ShareHelper.configureDirectShareMenuItem(this, menu.findItem(R.id.direct_share_menu_id)); - } - - @VisibleForTesting - public AppMenuHandler getAppMenuHandler() { - return mAppMenuHandler; - } - - @VisibleForTesting - public TabModelSelector getTabModelSelector() { - return mTabManager.getTabModelSelector(); - } - - /** - * Open a dialog that gives the user the option to sign in from a list of available accounts. - * - * @param fragmentManager the FragmentManager. - */ - private static void openSigninDialog(FragmentManager fragmentManager) { - AccountChooserFragment chooserFragment = new AccountChooserFragment(); - chooserFragment.show(fragmentManager, null); - } - - /** - * Open a dialog that gives the user the option to sign out. - * - * @param fragmentManager the FragmentManager. - */ - private static void openSignOutDialog(FragmentManager fragmentManager) { - SignoutFragment signoutFragment = new SignoutFragment(); - signoutFragment.show(fragmentManager, null); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java deleted file mode 100644 index 8fd5b04..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import org.chromium.base.CommandLine; -import org.chromium.base.PathUtils; -import org.chromium.base.ResourceExtractor; -import org.chromium.base.annotations.SuppressFBWarnings; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeApplication; -import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory; -import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; -import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGenerator; -import org.chromium.chrome.browser.metrics.UmaUtils; -import org.chromium.chrome.browser.smartcard.EmptyPKCS11AuthenticationManager; -import org.chromium.chrome.browser.smartcard.PKCS11AuthenticationManager; -import org.chromium.chrome.browser.sync.SyncController; -import org.chromium.chrome.shell.preferences.ChromeShellPreferences; -import org.chromium.ui.base.ResourceBundle; - -/** - * A basic test shell {@link android.app.Application}. Handles setting up the native library and - * loading the right resources. - */ -public class ChromeShellApplication extends ChromeApplication { - - private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "chromeshell"; - private static final String COMMAND_LINE_FILE = "/data/local/tmp/chrome-shell-command-line"; - - private static final String SESSIONS_UUID_PREF_KEY = "chromium.sync.sessions.id"; - - @Override - public void onCreate() { - // We want to do this at the earliest possible point in startup. - UmaUtils.recordMainEntryPointTime(); - super.onCreate(); - - // Assume that application start always leads to meaningful UMA startup metrics. This is not - // the case for the official Chrome on Android. - UmaUtils.setRunningApplicationStart(true); - - // Initialize the invalidations ID, just like we would in the downstream code. - UniqueIdInvalidationClientNameGenerator.doInitializeAndInstallGenerator(this); - - // Set up the identification generator for sync. The ID is actually generated - // in the SyncController constructor. - UniqueIdentificationGeneratorFactory.registerGenerator(SyncController.GENERATOR_ID, - new UuidBasedUniqueIdentificationGenerator(this, SESSIONS_UUID_PREF_KEY), false); - } - - @Override - protected void initializeLibraryDependencies() { - ResourceBundle.initializeLocalePaks(this, R.array.locale_paks); - ResourceExtractor.setResourcesToExtract(ResourceBundle.getActiveLocaleResources()); - PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, this); - } - - @SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") - @Override - public void initCommandLine() { - if (!CommandLine.isInitialized()) { - CommandLine.initFromFile(COMMAND_LINE_FILE); - } - } - - @Override - public String getSettingsActivityName() { - return ChromeShellPreferences.class.getName(); - } - - @Override - protected boolean areParentalControlsEnabled() { - return false; - } - - @Override - protected PKCS11AuthenticationManager getPKCS11AuthenticationManager() { - return EmptyPKCS11AuthenticationManager.getInstance(); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellServiceTabLauncher.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellServiceTabLauncher.java deleted file mode 100644 index 4780a14..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellServiceTabLauncher.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.provider.Browser; - -import org.chromium.components.service_tab_launcher.ServiceTabLauncher; -import org.chromium.ui.WindowOpenDisposition; - -/** - * Service Tab Launcher implementation for ChromeShell. Provides the ability for Chromium to - * launch tabs from background services, e.g. a Service Worker. - * - * This class is used as the Chrome Shell implementation of the ServiceTabLauncher, and is - * referred to per a meta-data section in the manifest file. - */ -public class ChromeShellServiceTabLauncher extends ServiceTabLauncher { - @Override - public void launchTab(Context context, int requestId, boolean incognito, String url, - int disposition, String referrerUrl, int referrerPolicy, - String extraHeaders, byte[] postData) { - Intent intent = new Intent(context, ChromeShellActivity.class); - intent.setAction(Intent.ACTION_MAIN); - intent.addCategory(Intent.CATEGORY_LAUNCHER); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.setData(Uri.parse(url)); - - switch (disposition) { - case WindowOpenDisposition.NEW_WINDOW: - case WindowOpenDisposition.NEW_POPUP: - case WindowOpenDisposition.NEW_FOREGROUND_TAB: - case WindowOpenDisposition.NEW_BACKGROUND_TAB: - // The browser should attempt to create a new tab. - intent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true); - break; - default: - // The browser should attempt to re-use an existing tab. - break; - } - - intent.putExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA, requestId); - - // TODO(peter): Support |incognito| when ChromeShell supports that. - // TODO(peter): Support the referrer information, extra headers and post data if - // ChromeShell gets support for those properties from intent extras. - - context.startActivity(intent); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellSwitches.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellSwitches.java deleted file mode 100644 index b6b87a4..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellSwitches.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -/** - * Command line switches for the shell. - */ -public abstract class ChromeShellSwitches { - // Enable the DOM Distiller. - public static final String ENABLE_DOM_DISTILLER = "enable-dom-distiller"; -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java deleted file mode 100644 index 0d860f8..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import android.content.Context; -import android.text.TextUtils; - -import org.chromium.chrome.browser.UrlUtilities; -import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator; -import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; -import org.chromium.content.browser.ContentViewClient; -import org.chromium.content_public.browser.LoadUrlParams; -import org.chromium.content_public.browser.NavigationController; -import org.chromium.content_public.browser.WebContents; -import org.chromium.content_public.common.Referrer; -import org.chromium.ui.base.WindowAndroid; - -/** - * ChromeShell's implementation of a tab. This mirrors how Chrome for Android subclasses - * and extends {@link Tab}. - */ -public class ChromeShellTab extends Tab { - private final TabManager mTabManager; - - // Tab state - private boolean mIsLoading; - private boolean mIsFullscreen = false; - - /** - * @param context The Context the view is running in. - * @param params Parameters for the page the tab should immediately load. - * @param window The WindowAndroid should represent this tab. - * @param contentViewClient The client for the {@link ContentViewCore}s of this Tab. - */ - public ChromeShellTab(Context context, LoadUrlParams params, WindowAndroid window, - ContentViewClient contentViewClient, TabManager tabManager) { - super(false, context, window); - initialize(null, null, false); - mTabManager = tabManager; - setContentViewClient(contentViewClient); - loadUrl(params); - } - - /** - * @return Whether or not the tab is currently loading. - */ - public boolean isLoading() { - return mIsLoading; - } - - /** - * Navigates this Tab to a sanitized version of {@code url}. - * @param url The potentially unsanitized URL to navigate to. - * @param postData Optional data to be sent via POST. - */ - public void loadUrlWithSanitization(String url, byte[] postData) { - if (url == null) return; - - // Sanitize the URL. - url = UrlUtilities.fixupUrl(url); - - // Invalid URLs will just return empty. - if (TextUtils.isEmpty(url)) return; - - WebContents webContents = getWebContents(); - NavigationController navigationController = webContents.getNavigationController(); - if (TextUtils.equals(url, webContents.getUrl())) { - navigationController.reload(true); - } else { - if (postData == null) { - navigationController.loadUrl(new LoadUrlParams(url)); - } else { - navigationController.loadUrl(LoadUrlParams.createLoadHttpPostParams(url, postData)); - } - } - } - - /** - * Navigates this Tab to a sanitized version of {@code url}. - * @param url The potentially unsanitized URL to navigate to. - */ - public void loadUrlWithSanitization(String url) { - loadUrlWithSanitization(url, null); - } - - @Override - protected TabChromeWebContentsDelegateAndroid createWebContentsDelegate() { - return new ChromeShellTabChromeWebContentsDelegateAndroid(); - } - - @Override - protected ContextMenuPopulator createContextMenuPopulator() { - return new ChromeContextMenuPopulator(new TabChromeContextMenuItemDelegate() { - @Override - public void onOpenInNewTab(String url, Referrer referrer) { - mTabManager.createTab(url, TabLaunchType.FROM_LONGPRESS_FOREGROUND); - } - - @Override - public void onOpenImageInNewTab(String url, Referrer referrer) { - mTabManager.createTab(url, TabLaunchType.FROM_LONGPRESS_FOREGROUND); - } - }); - } - - private class ChromeShellTabChromeWebContentsDelegateAndroid - extends TabChromeWebContentsDelegateAndroid { - @Override - public void onLoadStarted() { - mTabManager.hideTabSwitcher(); - mIsLoading = true; - super.onLoadStarted(); - } - - @Override - public void onLoadStopped() { - mIsLoading = false; - super.onLoadStopped(); - } - - @Override - public void toggleFullscreenModeForTab(boolean enterFullscreen) { - mIsFullscreen = enterFullscreen; - super.toggleFullscreenModeForTab(enterFullscreen); - } - - @Override - public boolean isFullscreenForTabOrPending() { - return mIsFullscreen; - } - - @Override - public void webContentsCreated(WebContents sourceWebContents, long openerRenderFrameId, - String frameName, String targetUrl, WebContents newWebContents) { - mTabManager.createTab(targetUrl, TabLaunchType.FROM_LINK); - super.webContentsCreated( - sourceWebContents, openerRenderFrameId, frameName, targetUrl, newWebContents); - } - } - - @Override - protected void openNewTab( - LoadUrlParams params, TabLaunchType launchType, Tab parentTab, boolean incognito) { - mTabManager.openNewTab(params, launchType, parentTab, incognito); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTabModel.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTabModel.java deleted file mode 100644 index 54a6f42..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTabModel.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModelBase; -import org.chromium.chrome.browser.tabmodel.TabModelDelegate; -import org.chromium.chrome.browser.tabmodel.TabModelOrderController; -import org.chromium.content_public.browser.WebContents; - -/** - * Basic implementation of TabModel for use in ChromeShell. - */ -public class ChromeShellTabModel extends TabModelBase { - - public ChromeShellTabModel(TabModelOrderController orderController, - TabModelDelegate modelDelegate) { - super(false, orderController, modelDelegate); - } - - @Override - protected boolean createTabWithWebContents(boolean incognito, WebContents webContents, - int parentId) { - return false; - } - - @Override - protected Tab createNewTabForDevTools(String url) { - assert false; - return null; - } - -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTabModelSelector.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTabModelSelector.java deleted file mode 100644 index f2a5830..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTabModelSelector.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import android.content.Context; - -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.EmptyTabModel; -import org.chromium.chrome.browser.tabmodel.TabModel; -import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; -import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; -import org.chromium.chrome.browser.tabmodel.TabModelDelegate; -import org.chromium.chrome.browser.tabmodel.TabModelOrderController; -import org.chromium.chrome.browser.tabmodel.TabModelSelectorBase; -import org.chromium.content.browser.ContentVideoViewClient; -import org.chromium.content.browser.ContentViewClient; -import org.chromium.content_public.browser.LoadUrlParams; -import org.chromium.ui.base.WindowAndroid; - -/** - * Basic implementation of TabModelSelector for use in ChromeShell. Only has a regular TabModel, - * no incognito one. - */ -class ChromeShellTabModelSelector extends TabModelSelectorBase { - - private final WindowAndroid mWindow; - private final ContentVideoViewClient mContentVideoViewClient; - private final Context mContext; - private final TabModelOrderController mOrderController; - - private TabManager mTabManager; - - public ChromeShellTabModelSelector( - WindowAndroid window, ContentVideoViewClient videoViewClient, Context context, - TabManager tabManager) { - mWindow = window; - mContentVideoViewClient = videoViewClient; - mContext = context; - mOrderController = new TabModelOrderController(this); - mTabManager = tabManager; - - TabModelDelegate tabModelDelegate = new TabModelDelegate() { - @Override - public void selectModel(boolean incognito) { - assert !incognito; - } - - @Override - public void requestToShowTab(Tab tab, TabSelectionType type) { - } - - @Override - public boolean isSessionRestoreInProgress() { - return false; - } - - @Override - public boolean isInOverviewMode() { - return mTabManager.isTabSwitcherVisible(); - } - - @Override - public TabModel getModel(boolean incognito) { - return ChromeShellTabModelSelector.this.getModel(incognito); - } - - @Override - public TabModel getCurrentModel() { - return ChromeShellTabModelSelector.this.getCurrentModel(); - } - - @Override - public boolean closeAllTabsRequest(boolean incognito) { - return false; - } - }; - TabModel tabModel = new ChromeShellTabModel(mOrderController, tabModelDelegate); - initialize(false, tabModel, EmptyTabModel.getInstance()); - markTabStateInitialized(); - } - - @Override - public Tab openNewTab(LoadUrlParams loadUrlParams, TabLaunchType type, Tab parent, - boolean incognito) { - assert !incognito; - ContentViewClient client = new ContentViewClient() { - @Override - public ContentVideoViewClient getContentVideoViewClient() { - return mContentVideoViewClient; - } - }; - ChromeShellTab tab = new ChromeShellTab( - mContext, loadUrlParams, mWindow, client, mTabManager); - int index = mOrderController.determineInsertionIndex(type, tab); - TabModel tabModel = getCurrentModel(); - tabModel.addTab(tab, index, type); - tabModel.setIndex(index, TabSelectionType.FROM_NEW); - return tab; - } - -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java deleted file mode 100644 index 55204db..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.content.res.Configuration; -import android.util.AttributeSet; -import android.view.KeyEvent; -import android.view.MotionEvent; -import android.view.View; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputMethodManager; -import android.widget.EditText; -import android.widget.ImageButton; -import android.widget.LinearLayout; -import android.widget.TextView; -import android.widget.TextView.OnEditorActionListener; - -import org.chromium.base.CommandLine; -import org.chromium.chrome.browser.UrlUtilities; -import org.chromium.chrome.browser.appmenu.AppMenuButtonHelper; -import org.chromium.chrome.browser.appmenu.AppMenuHandler; -import org.chromium.chrome.browser.tab.EmptyTabObserver; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tab.TabObserver; -import org.chromium.chrome.browser.widget.ToolbarProgressBar; -import org.chromium.chrome.shell.omnibox.SuggestionPopup; -import org.chromium.content.common.ContentSwitches; - -/** - * A Toolbar {@link View} that shows the URL and navigation buttons. - */ -public class ChromeShellToolbar extends LinearLayout { - - private final Runnable mUpdateProgressRunnable = new Runnable() { - private boolean mIsStarted = false; - - @Override - public void run() { - mStopReloadButton.setImageResource( - mLoading ? R.drawable.btn_close : R.drawable.btn_toolbar_reload); - - if (mProgress == 100.0f) { - if (mIsStarted) { - if (mProgressBar.getProgress() != 1.0f) mProgressBar.setProgress(1.0f); - mProgressBar.finish(true); - mIsStarted = false; - } - } else { - if (!mIsStarted) { - mProgressBar.start(); - mIsStarted = true; - } - mProgressBar.setProgress(mProgress / 100.0f); - } - } - }; - - private EditText mUrlTextView; - private ToolbarProgressBar mProgressBar; - - private ChromeShellTab mTab; - private final TabObserver mTabObserver; - - private AppMenuHandler mMenuHandler; - private AppMenuButtonHelper mAppMenuButtonHelper; - - private TabManager mTabManager; - - private SuggestionPopup mSuggestionPopup; - - private ImageButton mStopReloadButton; - private ImageButton mAddButton; - private int mProgress = 0; - private boolean mLoading = true; - private boolean mFocus = false; - - /** - * @param context The Context the view is running in. - * @param attrs The attributes of the XML tag that is inflating the view. - */ - public ChromeShellToolbar(Context context, AttributeSet attrs) { - super(context, attrs); - // When running performance benchmark, we don't want to observe the tab - // invalidation which would interfere with browser's processing content - // frame. See crbug.com/394976. - if (CommandLine.getInstance().hasSwitch( - ContentSwitches.RUNNING_PERFORMANCE_BENCHMARK)) { - mTabObserver = new EmptyTabObserver(); - } else { - mTabObserver = new TabObserverImpl(); - } - } - - /** - * The toolbar will visually represent the state of {@code tab}. - * @param tab The Tab that should be represented. - */ - public void showTab(ChromeShellTab tab) { - if (mTab != null) mTab.removeObserver(mTabObserver); - - mTab = tab; - - if (mTab != null) { - mTab.addObserver(mTabObserver); - mUrlTextView.setText(mTab.getWebContents().getUrl()); - } - } - - /** - * Set the TabManager responsible for activating the tab switcher. - * @param tabManager The active TabManager. - */ - public void setTabManager(TabManager tabManager) { - mTabManager = tabManager; - } - - private void onUpdateUrl(String url) { - mUrlTextView.setText(url); - } - - private void onLoadProgressChanged(int progress) { - removeCallbacks(mUpdateProgressRunnable); - mProgress = progress; - mLoading = progress != 100; - postOnAnimation(mUpdateProgressRunnable); - } - - /** - * Closes the suggestion popup. - */ - public void hideSuggestions() { - if (mSuggestionPopup != null) mSuggestionPopup.hideSuggestions(); - } - - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - - mProgressBar = (ToolbarProgressBar) findViewById(R.id.progress); - mProgressBar.initializeAnimation(); - initializeUrlField(); - initializeTabSwitcherButton(); - initializeMenuButton(); - initializeStopReloadButton(); - initializeAddButton(); - } - - void setMenuHandler(AppMenuHandler menuHandler) { - mMenuHandler = menuHandler; - mAppMenuButtonHelper = new AppMenuButtonHelper(mMenuHandler); - } - - private void initializeUrlField() { - mUrlTextView = (EditText) findViewById(R.id.url); - mUrlTextView.setOnEditorActionListener(new OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null - || event.getKeyCode() != KeyEvent.KEYCODE_ENTER - || event.getAction() != KeyEvent.ACTION_DOWN)) { - return false; - } - - // This will set |mTab| by calling showTab(). - // TODO(aurimas): Factor out initial tab creation to the activity level. - Tab tab = mTabManager.openUrl( - UrlUtilities.fixupUrl(mUrlTextView.getText().toString())); - mUrlTextView.clearFocus(); - setKeyboardVisibilityForUrl(false); - tab.getView().requestFocus(); - return true; - } - }); - mUrlTextView.setOnFocusChangeListener(new OnFocusChangeListener() { - @Override - public void onFocusChange(View v, boolean hasFocus) { - setKeyboardVisibilityForUrl(hasFocus); - mFocus = hasFocus; - updateToolbarState(); - if (!hasFocus && mTab != null) { - mUrlTextView.setText(mTab.getWebContents().getUrl()); - mSuggestionPopup.dismissPopup(); - } - } - }); - mUrlTextView.setOnKeyListener(new OnKeyListener() { - @Override - public boolean onKey(View v, int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_BACK) { - mUrlTextView.clearFocus(); - if (mTab != null) { - mTab.getView().requestFocus(); - } - return true; - } - return false; - } - }); - - mSuggestionPopup = new SuggestionPopup(getContext(), mUrlTextView, this); - mUrlTextView.addTextChangedListener(mSuggestionPopup); - } - - private void initializeTabSwitcherButton() { - ImageButton tabSwitcherButton = (ImageButton) findViewById(R.id.tab_switcher); - tabSwitcherButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (mTabManager != null) mTabManager.toggleTabSwitcher(); - } - }); - } - - private void initializeMenuButton() { - ImageButton menuButton = (ImageButton) findViewById(R.id.menu_button); - menuButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - if (mMenuHandler != null) mMenuHandler.showAppMenu(view, false); - } - }); - menuButton.setOnTouchListener(new OnTouchListener() { - @SuppressLint("ClickableViewAccessibility") - @Override - public boolean onTouch(View view, MotionEvent event) { - return mAppMenuButtonHelper != null && mAppMenuButtonHelper.onTouch(view, event); - } - }); - } - - private void initializeStopReloadButton() { - mStopReloadButton = (ImageButton) findViewById(R.id.stop_reload_button); - mStopReloadButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (mTab == null) return; - if (mLoading) { - mTab.getWebContents().stop(); - } else { - mTab.getWebContents().getNavigationController().reload(true); - } - } - }); - } - - private void initializeAddButton() { - mAddButton = (ImageButton) findViewById(R.id.add_button); - mAddButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - mTabManager.createNewTab(); - } - }); - } - - /** - * Shows or hides the add button, the stop/reload button and the URL bar. - */ - public void updateToolbarState() { - boolean tabSwitcherState = mTabManager.isTabSwitcherVisible(); - mAddButton.setVisibility(tabSwitcherState ? VISIBLE : GONE); - mStopReloadButton.setVisibility(tabSwitcherState || mFocus ? GONE : VISIBLE); - mUrlTextView.setVisibility(tabSwitcherState ? INVISIBLE : VISIBLE); - } - - /** - * @return Current tab that is shown by ChromeShell. - */ - public ChromeShellTab getCurrentTab() { - return mTab; - } - - /** - * Change the visibility of the software keyboard. - * @param visible Whether the keyboard should be shown or hidden. - */ - public void setKeyboardVisibilityForUrl(boolean visible) { - InputMethodManager imm = (InputMethodManager) getContext().getSystemService( - Context.INPUT_METHOD_SERVICE); - if (visible) { - imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); - } else { - imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); - } - } - - @Override - protected void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - if (mMenuHandler != null) mMenuHandler.hideAppMenu(); - } - - private class TabObserverImpl extends EmptyTabObserver { - @Override - public void onLoadProgressChanged(Tab tab, int progress) { - if (tab == mTab) ChromeShellToolbar.this.onLoadProgressChanged(progress); - } - - @Override - public void onUpdateUrl(Tab tab, String url) { - if (tab == mTab) ChromeShellToolbar.this.onUpdateUrl(url); - } - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java deleted file mode 100644 index db3306b..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.view.ViewParent; -import android.widget.FrameLayout; -import android.widget.LinearLayout; - -import org.chromium.base.VisibleForTesting; -import org.chromium.chrome.browser.tab.EmptyTabObserver; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver; -import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; -import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; -import org.chromium.chrome.browser.tabmodel.TabModelSelector; -import org.chromium.chrome.browser.widget.accessibility.AccessibilityTabModelWrapper; -import org.chromium.content.browser.ContentVideoViewClient; -import org.chromium.content.browser.ContentViewCore; -import org.chromium.content.browser.ContentViewRenderView; -import org.chromium.content_public.browser.LoadUrlParams; -import org.chromium.ui.base.PageTransition; -import org.chromium.ui.base.WindowAndroid; - -/** - * The TabManager hooks together all of the related {@link View}s that are used to represent - * a {@link ChromeShellTab}. It properly builds a {@link ChromeShellTab} and makes sure that the - * {@link ChromeShellToolbar} and {@link ContentViewRenderView} show the proper content. - */ -public class TabManager extends LinearLayout { - private static final String DEFAULT_URL = "https://www.google.com"; - - private ViewGroup mContentViewHolder; - private ContentViewRenderView mContentViewRenderView; - private ChromeShellToolbar mToolbar; - - private ChromeShellTab mCurrentTab; - - private String mStartupUrl = DEFAULT_URL; - - private ChromeShellTabModelSelector mTabModelSelector; - private AccessibilityTabModelWrapper mTabModelWrapper; - - private final EmptyTabModelObserver mTabModelObserver = new EmptyTabModelObserver() { - @Override - public void didSelectTab(Tab tab, TabSelectionType type, int lastId) { - assert tab instanceof ChromeShellTab; - setCurrentTab((ChromeShellTab) tab); - hideTabSwitcher(); - } - - @Override - public void willCloseTab(Tab tab, boolean animate) { - if (tab == mCurrentTab) setCurrentTab(null); - if (mTabModelSelector.getCurrentModel().getCount() == 1) { - createNewTab(); - } - } - }; - - /** - * @param context The Context the view is running in. - * @param attrs The attributes of the XML tag that is inflating the view. - */ - public TabManager(Context context, AttributeSet attrs) { - super(context, attrs); - } - - /** - * Initialize the components required for Tab creation. - * @param window The window used to generate all ContentViews. - * @param videoViewClient The client to handle interactions from ContentVideoViews. - */ - public void initialize(WindowAndroid window, ContentVideoViewClient videoViewClient) { - assert window != null; - assert videoViewClient != null; - - mContentViewHolder = (ViewGroup) findViewById(R.id.content_container); - - mTabModelSelector = new ChromeShellTabModelSelector( - window, videoViewClient, mContentViewHolder.getContext(), this); - mTabModelSelector.getModel(false).addObserver(mTabModelObserver); - - mToolbar = (ChromeShellToolbar) findViewById(R.id.toolbar); - mToolbar.setTabManager(this); - mContentViewRenderView = new ContentViewRenderView(getContext()) { - @Override - protected void onReadyToRender() { - if (mCurrentTab == null) createTab(mStartupUrl, TabLaunchType.FROM_RESTORE); - } - }; - mContentViewRenderView.onNativeLibraryLoaded(window); - mContentViewHolder.addView(mContentViewRenderView, - new FrameLayout.LayoutParams( - FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.MATCH_PARENT)); - } - - /** - * Get the ContentViewRenderView. - */ - public ContentViewRenderView getContentViewRenderView() { - return mContentViewRenderView; - } - - /** - * @param startupUrl The URL that the first tab should navigate to. - */ - public void setStartupUrl(String startupUrl) { - mStartupUrl = startupUrl; - } - - /** - * Enter or leave overlay video mode. - * @param enabled Whether overlay mode is enabled. - */ - public void setOverlayVideoMode(boolean enabled) { - if (mContentViewRenderView == null) return; - mContentViewRenderView.setOverlayVideoMode(enabled); - } - - /** - * @return The currently visible {@link ChromeShellTab}. - */ - public ChromeShellTab getCurrentTab() { - return mCurrentTab; - } - - /** - * Ensures that at least one tab exists, by opening a new one if necessary. - */ - public void ensureTabExists() { - if (mTabModelSelector.getCurrentModel().getCount() == 0) { - createNewTab(); - } - } - - /** - * Opens a new blank tab. - */ - public void createNewTab() { - createTab("about:blank", TabLaunchType.FROM_MENU_OR_OVERVIEW); - } - - /** - * Closes all current tabs. - */ - public void closeAllTabs() { - mTabModelSelector.getCurrentModel().closeAllTabs(); - } - - @VisibleForTesting - public void closeTab() { - mTabModelSelector.getCurrentModel().closeTab(mCurrentTab); - } - - /** - * Creates a {@link ChromeShellTab} with a URL specified by {@code url}. - * @param url The URL the new {@link ChromeShellTab} should start with. - * @return The newly created tab, or null if the content view is uninitialized. - */ - public Tab createTab(String url, TabLaunchType type) { - if (!isContentViewRenderViewInitialized()) return null; - - LoadUrlParams loadUrlParams = new LoadUrlParams(url); - Tab tab = mTabModelSelector.openNewTab(loadUrlParams, type, null, false); - tab.addObserver(new EmptyTabObserver() { - @Override - public void onToggleFullscreenMode(Tab tab, boolean enable) { - mToolbar.setVisibility(enable ? GONE : VISIBLE); - } - - @Override - public void onContentChanged(Tab tab) { - setupContent(); - } - }); - return tab; - } - - void openNewTab( - LoadUrlParams params, TabLaunchType launchType, Tab parentTab, boolean incognito) { - mTabModelSelector.openNewTab(params, launchType, parentTab, incognito); - } - - private boolean isContentViewRenderViewInitialized() { - return mContentViewRenderView != null && mContentViewRenderView.isInitialized(); - } - - private void setCurrentTab(ChromeShellTab tab) { - if (mCurrentTab != null) { - mContentViewHolder.removeView(mCurrentTab.getView()); - } - - mCurrentTab = tab; - - mToolbar.showTab(mCurrentTab); - - if (mCurrentTab != null) setupContent(); - } - - private void setupContent() { - View view = mCurrentTab.getView(); - ContentViewCore contentViewCore = mCurrentTab.getContentViewCore(); - mContentViewHolder.addView(view); - mContentViewRenderView.setCurrentContentViewCore(contentViewCore); - view.requestFocus(); - contentViewCore.onShow(); - } - - /** - * Hide the tab switcher. - */ - public void hideTabSwitcher() { - if (mTabModelWrapper == null) return; - if (!isTabSwitcherVisible()) return; - ViewParent parent = mTabModelWrapper.getParent(); - if (parent != null) { - assert parent == mContentViewHolder; - mContentViewHolder.removeView(mTabModelWrapper); - } - mToolbar.updateToolbarState(); - } - - /** - * Shows the tab switcher. - */ - private void showTabSwitcher() { - if (mTabModelWrapper == null) { - mTabModelWrapper = (AccessibilityTabModelWrapper) LayoutInflater.from( - mContentViewHolder.getContext()).inflate( - R.layout.accessibility_tab_switcher, null); - mTabModelWrapper.setup(null); - mTabModelWrapper.setTabModelSelector(mTabModelSelector); - } - - if (mTabModelWrapper.getParent() == null) { - mContentViewHolder.addView(mTabModelWrapper); - } - mToolbar.updateToolbarState(); - } - - /** - * Returns the visibility status of the tab switcher. - */ - public boolean isTabSwitcherVisible() { - return mTabModelWrapper != null && mTabModelWrapper.getParent() == mContentViewHolder; - } - - /** - * Toggles the tab switcher visibility. - */ - public void toggleTabSwitcher() { - if (!isTabSwitcherVisible()) { - showTabSwitcher(); - } else { - hideTabSwitcher(); - } - } - - /** - * Opens a URL in the current tab if one exists, or in a new tab otherwise. - * @param url The URL to open. - * @return The tab used to open the provided URL. - */ - public Tab openUrl(String url) { - LoadUrlParams loadUrlParams = new LoadUrlParams(url); - loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FROM_ADDRESS_BAR); - Tab tab = mTabModelSelector.getCurrentTab(); - if (tab != null) { - tab.loadUrl(loadUrlParams); - return tab; - } - return createTab(url, TabLaunchType.FROM_KEYBOARD); - } - - /** - * Returns the TabModelSelector containing the tabs. - */ - public TabModelSelector getTabModelSelector() { - return mTabModelSelector; - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/invalidation/ChromeShellSyncAdapter.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/invalidation/ChromeShellSyncAdapter.java deleted file mode 100644 index 7e962325..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/invalidation/ChromeShellSyncAdapter.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.invalidation; - -import android.app.Application; -import android.content.Context; - -import org.chromium.chrome.browser.invalidation.ChromiumSyncAdapter; - -public class ChromeShellSyncAdapter extends ChromiumSyncAdapter { - public ChromeShellSyncAdapter(Context appContext, Application application) { - super(appContext, application); - } - - @Override - protected boolean useAsyncStartup() { - return true; - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/invalidation/ChromeShellSyncAdapterService.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/invalidation/ChromeShellSyncAdapterService.java deleted file mode 100644 index 70e010e..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/invalidation/ChromeShellSyncAdapterService.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.invalidation; - -import android.app.Application; -import android.content.Context; - -import org.chromium.chrome.browser.invalidation.ChromiumSyncAdapter; -import org.chromium.chrome.browser.invalidation.ChromiumSyncAdapterService; - -public class ChromeShellSyncAdapterService extends ChromiumSyncAdapterService { - @Override - protected ChromiumSyncAdapter createChromiumSyncAdapter( - Context context, Application application) { - return new ChromeShellSyncAdapter(context, getApplication()); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionArrayAdapter.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionArrayAdapter.java deleted file mode 100644 index 30abb4e..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionArrayAdapter.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.omnibox; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AbsListView.LayoutParams; -import android.widget.ArrayAdapter; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.TextView; - -import org.chromium.chrome.browser.omnibox.OmniboxSuggestion; -import org.chromium.chrome.shell.R; - -import java.util.List; - -/** - * Adapter that provides suggestion views for the suggestion popup. - */ -class SuggestionArrayAdapter extends ArrayAdapter<OmniboxSuggestion> { - private final List<OmniboxSuggestion> mSuggestions; - private EditText mUrlTextView; - - public SuggestionArrayAdapter(Context context, int res, List<OmniboxSuggestion> suggestions, - EditText urlTextView) { - super(context, res, suggestions); - mSuggestions = suggestions; - mUrlTextView = urlTextView; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - View v = convertView; - if (v == null) { - LayoutInflater vi = (LayoutInflater) getContext().getSystemService( - Context.LAYOUT_INFLATER_SERVICE); - v = vi.inflate(R.layout.suggestion_item, null); - int height = getContext().getResources().getDimensionPixelSize( - R.dimen.dropdown_item_height); - v.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, height)); - } - TextView t1 = (TextView) v.findViewById(R.id.suggestion_item_label); - final String suggestionText = mSuggestions.get(position).getDisplayText(); - t1.setText(suggestionText); - - TextView t2 = (TextView) v.findViewById(R.id.suggestion_item_sublabel); - t2.setText(mSuggestions.get(position).getUrl()); - - ImageView arrow = (ImageView) v.findViewById(R.id.suggestion_item_arrow); - arrow.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mUrlTextView.setText(suggestionText); - mUrlTextView.setSelection(suggestionText.length()); - } - }); - return v; - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java deleted file mode 100644 index a87ebcb..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/omnibox/SuggestionPopup.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.omnibox; - -import android.content.Context; -import android.graphics.Rect; -import android.os.Handler; -import android.text.Editable; -import android.text.TextUtils; -import android.text.TextWatcher; -import android.view.View; -import android.view.View.OnLayoutChangeListener; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.EditText; -import android.widget.ListPopupWindow; -import android.widget.PopupWindow.OnDismissListener; - - -import org.chromium.chrome.browser.omnibox.AutocompleteController; -import org.chromium.chrome.browser.omnibox.AutocompleteController.OnSuggestionsReceivedListener; -import org.chromium.chrome.browser.omnibox.OmniboxSuggestion; -import org.chromium.chrome.shell.ChromeShellActivity; -import org.chromium.chrome.shell.ChromeShellToolbar; -import org.chromium.chrome.shell.R; - -import java.util.List; - -/** - * Displays suggestions for the text that is entered to the ChromeShell URL field. - */ -public class SuggestionPopup implements OnSuggestionsReceivedListener, TextWatcher { - private static final long SUGGESTION_START_DELAY_MS = 30; - - private final Context mContext; - private final EditText mUrlField; - private final ChromeShellToolbar mToolbar; - private final AutocompleteController mAutocomplete; - - private boolean mHasStartedNewOmniboxEditSession; - private Runnable mRequestSuggestions; - private ListPopupWindow mSuggestionsPopup; - private SuggestionArrayAdapter mSuggestionArrayAdapter; - private int mSuggestionsPopupItemsCount; - - /** - * Initializes a suggestion popup that will track urlField value and display suggestions based - * on that value. - */ - public SuggestionPopup(Context context, EditText urlField, ChromeShellToolbar toolbar) { - mContext = context; - mUrlField = urlField; - mToolbar = toolbar; - mAutocomplete = new AutocompleteController(this); - OnLayoutChangeListener listener = new OnLayoutChangeListener() { - @Override - public void onLayoutChange(View v, int left, int top, int right, int bottom, - int oldLeft, int oldTop, int oldRight, int oldBottom) { - if (mSuggestionsPopup == null || !mSuggestionsPopup.isShowing()) return; - mSuggestionsPopup.setWidth(mToolbar.getWidth()); - mSuggestionsPopup.setHeight(getSuggestionPopupHeight()); - mSuggestionsPopup.show(); - } - }; - mUrlField.addOnLayoutChangeListener(listener); - } - - private void navigateToSuggestion(int position) { - mToolbar.getCurrentTab().loadUrlWithSanitization( - mSuggestionArrayAdapter.getItem(position).getUrl()); - mUrlField.clearFocus(); - mToolbar.setKeyboardVisibilityForUrl(false); - mToolbar.getCurrentTab().getView().requestFocus(); - dismissPopup(); - } - - public void dismissPopup() { - if (mSuggestionsPopup != null) { - mSuggestionsPopup.dismiss(); - mSuggestionsPopup = null; - } - } - - /** - * Stops the autocomplete controller and closes the suggestion popup. - */ - public void hideSuggestions() { - stopAutocomplete(true); - dismissPopup(); - } - - /** - * Signals the autocomplete controller to stop generating suggestions and - * cancels the queued task to start the autocomplete controller, if any. - * - * @param clear Whether to clear the most recent autocomplete results. - */ - private void stopAutocomplete(boolean clear) { - if (mAutocomplete != null) mAutocomplete.stop(clear); - if (mRequestSuggestions != null) mRequestSuggestions = null; - } - - private int getSuggestionPopupHeight() { - Rect appRect = new Rect(); - ((ChromeShellActivity) mContext).getWindow().getDecorView() - .getWindowVisibleDisplayFrame(appRect); - int dropDownItemHeight = mContext.getResources() - .getDimensionPixelSize(R.dimen.dropdown_item_height); - // Applying margin height equal to |dropDownItemHeight| if constrained by app rect. - int popupHeight = appRect.height() - dropDownItemHeight; - if (mSuggestionsPopup != null) { - int height = mSuggestionsPopupItemsCount * dropDownItemHeight; - if (height < popupHeight) popupHeight = height; - } - return popupHeight; - } - - // OnSuggestionsReceivedListener implementation - @Override - public void onSuggestionsReceived(List<OmniboxSuggestion> suggestions, - String inlineAutocompleteText) { - if (!mUrlField.isFocused() || suggestions.isEmpty()) return; - mSuggestionsPopupItemsCount = suggestions.size(); - if (mSuggestionsPopup == null) { - mSuggestionsPopup = new ListPopupWindow( - mContext, null, android.R.attr.autoCompleteTextViewStyle); - mSuggestionsPopup.setOnDismissListener(new OnDismissListener() { - @Override - public void onDismiss() { - mHasStartedNewOmniboxEditSession = false; - mSuggestionArrayAdapter = null; - } - }); - } - mSuggestionsPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED); - mSuggestionsPopup.setWidth(mToolbar.getWidth()); - mSuggestionArrayAdapter = - new SuggestionArrayAdapter(mContext, R.layout.dropdown_item, suggestions, - mUrlField); - mSuggestionsPopup.setHeight(getSuggestionPopupHeight()); - mSuggestionsPopup.setAdapter(mSuggestionArrayAdapter); - mSuggestionsPopup.setAnchorView(mToolbar); - mSuggestionsPopup.setOnItemClickListener(new OnItemClickListener() { - @Override - public void onItemClick(AdapterView<?> parent, View view, int position, long id) { - navigateToSuggestion(position); - } - }); - mSuggestionsPopup.show(); - } - - // TextWatcher implementation - - @Override - public void afterTextChanged(final Editable editableText) { - if (!mUrlField.hasFocus()) return; - if (!mHasStartedNewOmniboxEditSession) { - mAutocomplete.resetSession(); - mHasStartedNewOmniboxEditSession = true; - } - - stopAutocomplete(false); - if (TextUtils.isEmpty(editableText)) { - dismissPopup(); - } else { - assert mRequestSuggestions == null : "Multiple omnibox requests in flight."; - mRequestSuggestions = new Runnable() { - @Override - public void run() { - // TODO(aurimas): Create new tab if none exists. - if (mToolbar.getCurrentTab() == null) return; - mRequestSuggestions = null; - mAutocomplete.start( - mToolbar.getCurrentTab().getProfile(), - mToolbar.getCurrentTab().getUrl(), - editableText.toString(), false); - } - }; - new Handler().postDelayed(mRequestSuggestions, SUGGESTION_START_DELAY_MS); - } - } - - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { - mRequestSuggestions = null; - } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/ChromeShellMainPreferences.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/ChromeShellMainPreferences.java deleted file mode 100644 index a3b7782..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/ChromeShellMainPreferences.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.preferences; - -import android.os.Bundle; -import android.preference.PreferenceFragment; - -import org.chromium.chrome.shell.R; - -/** - * The main settings fragment for Chrome Shell. - */ -public class ChromeShellMainPreferences extends PreferenceFragment { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.chrome_shell_main_preferences); - } -}
\ No newline at end of file diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/ChromeShellPreferences.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/ChromeShellPreferences.java deleted file mode 100644 index 40c7419..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/ChromeShellPreferences.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.preferences; - -import org.chromium.base.library_loader.LibraryProcessType; -import org.chromium.base.library_loader.ProcessInitException; -import org.chromium.chrome.browser.preferences.Preferences; -import org.chromium.content.browser.BrowserStartupController; - -/** - * The Settings activity for Chrome Shell. - */ -public class ChromeShellPreferences extends Preferences { - - @Override - protected void startBrowserProcessSync() throws ProcessInitException { - BrowserStartupController.get(this, LibraryProcessType.PROCESS_BROWSER) - .startBrowserProcessesSync(false); - } - - @Override - protected String getTopLevelFragmentName() { - return ChromeShellMainPreferences.class.getName(); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/OWNERS b/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/OWNERS deleted file mode 100644 index d3d70d2..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/preferences/OWNERS +++ /dev/null @@ -1 +0,0 @@ -newt@chromium.org diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/AccountChooserFragment.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/AccountChooserFragment.java deleted file mode 100644 index 40a2530..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/AccountChooserFragment.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.signin; - -import android.app.Dialog; -import android.app.DialogFragment; -import android.content.DialogInterface; -import android.os.Bundle; -import android.support.v7.app.AlertDialog; - -import org.chromium.chrome.browser.sync.SyncController; -import org.chromium.chrome.shell.R; -import org.chromium.sync.signin.AccountManagerHelper; - -import java.util.List; - -/** - * The fragment to show when the user is given the option to sign in to Chromium. - * - * It lists the available Google accounts on the device and makes the user choose one. - */ -public class AccountChooserFragment - extends DialogFragment implements DialogInterface.OnClickListener { - private String[] mAccounts; - private int mSelectedAccount; - - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - List<String> accountsList = AccountManagerHelper.get(getActivity()).getGoogleAccountNames(); - mAccounts = accountsList.toArray(new String[accountsList.size()]); - return new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) - .setTitle(R.string.signin_select_account) - .setSingleChoiceItems(mAccounts, mSelectedAccount, this) - .setPositiveButton(R.string.signin_sign_in, this) - .setNegativeButton(R.string.signin_cancel, this) - .create(); - } - - @Override - public void onClick(DialogInterface dialog, int which) { - switch (which) { - case DialogInterface.BUTTON_POSITIVE: { - selectAccount(mAccounts[mSelectedAccount]); - break; - } - case DialogInterface.BUTTON_NEGATIVE: { - dismiss(); - break; - } - default: { - mSelectedAccount = which; - break; - } - } - } - - private void selectAccount(String accountName) { - SyncController.get(getActivity()).signIn(getActivity(), accountName); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/AccountsChangedReceiver.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/AccountsChangedReceiver.java deleted file mode 100644 index 81c71a3..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/AccountsChangedReceiver.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.signin; - -import android.accounts.Account; -import android.accounts.AccountManager; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -import org.chromium.base.ThreadUtils; -import org.chromium.base.annotations.SuppressFBWarnings; -import org.chromium.base.library_loader.LibraryProcessType; -import org.chromium.base.library_loader.ProcessInitException; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.signin.OAuth2TokenService; -import org.chromium.content.browser.BrowserStartupController; -import org.chromium.sync.signin.ChromeSigninController; - -/** - * A BroadcastReceiver for acting on changes to Android accounts. - */ -public class AccountsChangedReceiver extends BroadcastReceiver { - private static final String TAG = "AccountsChangedReceiver"; - - @Override - public void onReceive(final Context context, Intent intent) { - if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(intent.getAction())) { - final Account signedInUser = - ChromeSigninController.get(context).getSignedInUser(); - if (signedInUser != null) { - BrowserStartupController.StartupCallback callback = - new BrowserStartupController.StartupCallback() { - @Override - public void onSuccess(boolean alreadyStarted) { - OAuth2TokenService.getForProfile(Profile.getLastUsedProfile()) - .validateAccounts(context, false); - } - - @Override - public void onFailure() { - Log.w(TAG, "Failed to start browser process."); - } - }; - startBrowserProcessOnUiThread(context, callback); - } - } - } - - private static void startBrowserProcessOnUiThread(final Context context, - final BrowserStartupController.StartupCallback callback) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - @SuppressFBWarnings("DM_EXIT") - public void run() { - try { - BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER) - .startBrowserProcessesAsync(callback); - } catch (ProcessInitException e) { - Log.e(TAG, "Unable to load native library.", e); - System.exit(-1); - } - } - }); - } -} diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/SignoutFragment.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/SignoutFragment.java deleted file mode 100644 index aff3c40..0000000 --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/signin/SignoutFragment.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell.signin; - -import android.app.Dialog; -import android.app.DialogFragment; -import android.content.DialogInterface; -import android.os.Bundle; -import android.support.v7.app.AlertDialog; - -import org.chromium.chrome.browser.signin.SigninManager; -import org.chromium.chrome.shell.R; - -/** - * The fragment to show when the user is given the option to sign out of Chromium. - */ -public class SignoutFragment extends DialogFragment implements DialogInterface.OnClickListener { - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - return new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) - .setTitle(R.string.signout_title) - .setPositiveButton(R.string.signout_sign_out, this) - .setNegativeButton(R.string.signout_cancel, this) - .create(); - } - - @Override - public void onClick(DialogInterface dialog, int which) { - switch (which) { - case DialogInterface.BUTTON_POSITIVE: { - SigninManager.get(getActivity()).signOut(getActivity(), null); - break; - } - case DialogInterface.BUTTON_NEGATIVE: { - dismiss(); - break; - } - default: - break; - } - } -} diff --git a/chrome/android/shell/javatests/AndroidManifest.xml b/chrome/android/shell/javatests/AndroidManifest.xml deleted file mode 100644 index 8069c9b..0000000 --- a/chrome/android/shell/javatests/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - <!-- Copyright (c) 2012 The Chromium Authors. All rights reserved. Use of - this source code is governed by a BSD-style license that can be found - in the LICENSE file. --> - <!-- package name must be unique so suffix with "tests" so package loader - doesn't ignore this. --> - <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.chromium.chrome.shell.tests"> - <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" /> - <uses-permission android:name="android.permission.RUN_INSTRUMENTATION" /> - <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> - <uses-permission android:name="android.permission.READ_LOGS"/> - <uses-permission android:name="android.permission.WAKE_LOCK" /> - <!-- We add an application tag here just so that we can indicate that this - package needs to link against the android.test library, which is - needed when building test cases. --> - <application> - <uses-library android:name="android.test.runner" /> - - <activity android:name="org.chromium.test.broker.OnDeviceInstrumentationBroker" - android:exported="true"/> - - <activity android:name="org.chromium.sync.test.util.MockGrantCredentialsPermissionActivity" - android:exported="false"> - <intent-filter> - <action android:name="android.intent.action.VIEW" /> - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - </activity> - </application> - <instrumentation android:name="org.chromium.chrome.test.ChromeInstrumentationTestRunner" - android:targetPackage="org.chromium.chrome.shell" - android:label="Tests for org.chromium.chrome.shell"/> -</manifest> diff --git a/chrome/android/shell/javatests/OWNERS b/chrome/android/shell/javatests/OWNERS deleted file mode 100644 index a1e5746..0000000 --- a/chrome/android/shell/javatests/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -dfalcantara@chromium.org -dtrainor@chromium.org -miguelg@chromium.org -nyquist@chromium.org -skyostil@chromium.org -tedchoc@chromium.org -yfriedman@chromium.org diff --git a/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java b/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java deleted file mode 100644 index 5ff0168..0000000 --- a/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.text.TextUtils; -import android.util.Log; - -import org.chromium.base.ThreadUtils; -import org.chromium.base.library_loader.ProcessInitException; -import org.chromium.base.test.BaseActivityInstrumentationTestCase; -import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.chrome.test.util.ApplicationData; -import org.chromium.content.browser.test.util.Criteria; -import org.chromium.content.browser.test.util.CriteriaHelper; -import org.chromium.content.common.ContentSwitches; -import org.chromium.content_public.browser.LoadUrlParams; - -import java.util.concurrent.Callable; - -/** - * Base test class for all ChromeShell based tests. - */ -@CommandLineFlags.Add(ContentSwitches.ENABLE_TEST_INTENTS) -public class ChromeShellTestBase extends BaseActivityInstrumentationTestCase<ChromeShellActivity> { - /** The maximum time the waitForActiveShellToBeDoneLoading method will wait. */ - private static final long WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT = scaleTimeout(10000); - private static final String TAG = "ChromeShellTestBase"; - - public ChromeShellTestBase() { - super(ChromeShellActivity.class); - } - - protected static void startChromeBrowserProcessSync(final Context context) { - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - try { - ((ChromeShellApplication) context.getApplicationContext()) - .startBrowserProcessesAndLoadLibrariesSync(true); - } catch (ProcessInitException e) { - Log.e(TAG, "Unable to load native library.", e); - } - } - }); - } - - /** - * Starts the {@link ChromeShellActivity} and loads the given URL. - */ - protected ChromeShellActivity launchChromeShellWithUrl(String url) { - Intent intent = new Intent(Intent.ACTION_MAIN); - intent.addCategory(Intent.CATEGORY_LAUNCHER); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - if (url != null) intent.setData(Uri.parse(url)); - intent.setComponent(new ComponentName(getInstrumentation().getTargetContext(), - ChromeShellActivity.class)); - setActivityIntent(intent); - return getActivity(); - } - - /** - * Starts the {@link ChromeShellActivity} and loads a blank page. - */ - protected ChromeShellActivity launchChromeShellWithBlankPage() { - return launchChromeShellWithUrl("about:blank"); - } - - /** - * Waits for the Active shell to finish loading. This times out after - * WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT milliseconds and it shouldn't be used for long - * loading pages. Instead it should be used more for test initialization. The proper way - * to wait is to use a TestCallbackHelperContainer after the initial load is completed. - * @return Whether or not the Shell was actually finished loading. - * @throws InterruptedException - */ - protected boolean waitForActiveShellToBeDoneLoading() throws InterruptedException { - final ChromeShellActivity activity = getActivity(); - - // Wait for the Content Shell to be initialized. - return CriteriaHelper.pollForCriteria(new Criteria() { - @Override - public boolean isSatisfied() { - return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Boolean>() { - @Override - public Boolean call() throws Exception { - ChromeShellTab tab = activity.getActiveTab(); - if (tab != null) { - return !tab.isLoading() - && !TextUtils.isEmpty(tab.getContentViewCore() - .getWebContents().getUrl()); - } else { - return false; - } - } - }); - } - }, WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT, CriteriaHelper.DEFAULT_POLLING_INTERVAL); - } - - /** - * Clear all files and folders in the ChromeShell's application directory except 'lib'. - * - * The 'cache' directory is recreated as an empty directory. - * - * @return Whether clearing the application data was successful. - */ - protected boolean clearAppData() throws InterruptedException { - return ApplicationData.clearAppData(getInstrumentation().getTargetContext()); - } - - /** - * Navigates the currently active tab to {@code url} and waits for the page to finish loading. - */ - public void loadUrl(final String url) throws InterruptedException { - getInstrumentation().runOnMainSync(new Runnable() { - @Override - public void run() { - getActivity().getActiveTab().loadUrl(new LoadUrlParams(url)); - } - }); - waitForActiveShellToBeDoneLoading(); - } - - /** - * Navigates the currently active tab to a sanitized version of {@code url}. - * @param url The potentially unsanitized URL to navigate to. - */ - public void loadUrlWithSanitization(final String url) throws InterruptedException { - getInstrumentation().runOnMainSync(new Runnable() { - @Override - public void run() { - getActivity().getActiveTab().loadUrlWithSanitization(url); - } - }); - waitForActiveShellToBeDoneLoading(); - } - - // TODO(aelias): This method needs to be removed once http://crbug.com/179511 is fixed. - // Meanwhile, we have to wait if the page has the <meta viewport> tag. - /** - * Waits till the ContentViewCore receives the expected page scale factor - * from the compositor and asserts that this happens. - */ - protected void assertWaitForPageScaleFactorMatch(final float expectedScale) - throws InterruptedException { - assertTrue(CriteriaHelper.pollForCriteria(new Criteria() { - @Override - public boolean isSatisfied() { - return getActivity().getActiveTab().getContentViewCore().getScale() - == expectedScale; - } - })); - } -} diff --git a/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellUrlTest.java b/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellUrlTest.java deleted file mode 100644 index 0932b7b..0000000 --- a/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellUrlTest.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.shell; - -import android.test.suitebuilder.annotation.SmallTest; - -import org.chromium.base.ThreadUtils; -import org.chromium.base.test.util.Feature; -import org.chromium.content.browser.ContentViewCore; -import org.chromium.content.browser.ContentViewRenderView; -import org.chromium.ui.base.WindowAndroid; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; - -/** - * Basic sanity test for loading urls in ChromeShell. - */ -public class ChromeShellUrlTest extends ChromeShellTestBase { - // URL used for base tests. - private static final String URL = "data:text"; - - @SmallTest - @Feature({"Main"}) - public void testBaseStartup() throws InterruptedException { - ChromeShellActivity activity = launchChromeShellWithUrl(URL); - waitForActiveShellToBeDoneLoading(); - - // Make sure the activity was created as expected. - assertNotNull(activity); - } - - @SmallTest - @Feature({"Main"}) - public void testChromeUrlPageLoads() throws InterruptedException { - // Test flags page because it will *probably* never get removed. - String flagsUrl = "chrome://flags/"; - final ChromeShellActivity activity = launchChromeShellWithUrl(flagsUrl); - waitForActiveShellToBeDoneLoading(); - - // Make sure the activity was created as expected. - assertNotNull(activity); - - // Ensure we have a valid ContentViewCore. - final AtomicReference<ContentViewCore> contentViewCore = - new AtomicReference<ContentViewCore>(); - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - contentViewCore.set(activity.getActiveContentViewCore()); - } - }); - assertNotNull(contentViewCore.get()); - assertNotNull(contentViewCore.get().getContainerView()); - - // Ensure the correct page has been loaded, ie. not interstitial, and title/url should - // be sane. - final AtomicBoolean isShowingInterstitialPage = new AtomicBoolean(); - final AtomicReference<String> url = new AtomicReference<String>(); - final AtomicReference<String> title = new AtomicReference<String>(); - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - isShowingInterstitialPage.set(contentViewCore.get().getWebContents() - .isShowingInterstitialPage()); - url.set(contentViewCore.get().getWebContents().getUrl()); - title.set(contentViewCore.get().getWebContents().getTitle()); - } - }); - assertFalse("Showed interstitial page instead of welcome page", - isShowingInterstitialPage.get()); - assertNotNull("URL was null", url.get()); - assertTrue("URL did not contain: " + flagsUrl + ". Was: " + url.get(), - url.get().contains(flagsUrl)); - assertNotNull("Title was null", title.get()); - } - - /** - * Tests that creating an extra ContentViewRenderView does not cause an assert because we would - * initialize the compositor twice http://crbug.com/162312 - */ - @SmallTest - @Feature({"Main"}) - public void testCompositorInit() throws InterruptedException { - // Start the ChromeShell, this loads the native library and create an instance of - // ContentViewRenderView. - final ChromeShellActivity activity = launchChromeShellWithUrl(URL); - waitForActiveShellToBeDoneLoading(); - - // Now create a new ContentViewRenderView, it should not assert. - try { - runTestOnUiThread(new Runnable() { - @Override - public void run() { - WindowAndroid windowAndroid = new WindowAndroid( - getInstrumentation().getTargetContext().getApplicationContext()); - ContentViewRenderView contentViewRenderView = - new ContentViewRenderView(getInstrumentation().getTargetContext()); - contentViewRenderView.onNativeLibraryLoaded(windowAndroid); - contentViewRenderView.setCurrentContentViewCore( - activity.getActiveContentViewCore()); - } - }); - } catch (Throwable e) { - e.printStackTrace(); - fail("Could not create a ContentViewRenderView: " + e); - } - } -} diff --git a/chrome/android/shell/res/drawable/suggestion_arrow.png b/chrome/android/shell/res/drawable/suggestion_arrow.png Binary files differdeleted file mode 100644 index 33e4e0e..0000000 --- a/chrome/android/shell/res/drawable/suggestion_arrow.png +++ /dev/null diff --git a/chrome/android/shell/res/layout/chrome_shell_activity.xml b/chrome/android/shell/res/layout/chrome_shell_activity.xml deleted file mode 100644 index 9a928d7..0000000 --- a/chrome/android/shell/res/layout/chrome_shell_activity.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Copyright 2014 The Chromium Authors. All rights reserved. - - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - --> - -<org.chromium.chrome.shell.TabManager android:id="@+id/tab_manager" - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:chrome="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - <org.chromium.chrome.shell.ChromeShellToolbar android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> - <org.chromium.chrome.browser.widget.TintedImageButton - android:id="@+id/add_button" - android:layout_width="38dp" - android:layout_height="38dp" - android:src="@android:drawable/ic_menu_add" - android:visibility="gone" - android:scaleType="center"/> - <org.chromium.chrome.browser.widget.TintedImageButton - android:id="@+id/stop_reload_button" - android:layout_width="38dp" - android:layout_height="38dp" - android:src="@drawable/btn_close" - android:background="?attr/selectableItemBackground" - android:scaleType="center"/> - <EditText android:id="@+id/url" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="bottom" - android:textSize="18sp" - android:singleLine="true" - android:selectAllOnFocus="true" - android:hint="@string/url_hint" - android:inputType="textUri" - android:imeOptions="actionGo|flagNoExtractUi" /> - <org.chromium.chrome.browser.widget.TintedImageButton - android:id="@+id/tab_switcher" - android:layout_width="38dp" - android:layout_height="38dp" - android:src="@drawable/btn_tabswitcher" - android:background="?attr/selectableItemBackground" - android:scaleType="center" - android:contentDescription="@null"/> - <org.chromium.chrome.browser.widget.TintedImageButton - android:id="@+id/menu_button" - android:layout_width="38dp" - android:layout_height="38dp" - android:src="@drawable/btn_menu" - android:background="?attr/selectableItemBackground" - android:scaleType="center"/> - </LinearLayout> - <org.chromium.chrome.browser.widget.ToolbarProgressBar - android:id="@+id/progress" - android:layout_width="match_parent" - android:layout_height="2dp" - chrome:progressBarColor="@color/material_deep_teal_500" - chrome:backgroundColor="@android:color/transparent" /> - </org.chromium.chrome.shell.ChromeShellToolbar> - <FrameLayout android:id="@+id/content_container" - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1"> - </FrameLayout> - -</org.chromium.chrome.shell.TabManager> diff --git a/chrome/android/shell/res/layout/suggestion_item.xml b/chrome/android/shell/res/layout/suggestion_item.xml deleted file mode 100644 index 3963790..0000000 --- a/chrome/android/shell/res/layout/suggestion_item.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2014 The Chromium Authors. All rights reserved. - - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/suggestion_item" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:gravity="center_vertical" - android:orientation="horizontal"> - - <LinearLayout - android:id="@+id/inner_layout" - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_weight="1" - android:orientation="vertical" - android:layout_gravity="center_vertical"> - - <TextView android:id="@+id/suggestion_item_label" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="10dp" - android:layout_marginEnd="10dp" - android:ellipsize="end" - android:singleLine="true" - android:textAlignment="viewStart" - android:gravity="start" - android:textSize="18sp" - android:includeFontPadding="false"/> - - <TextView android:id="@+id/suggestion_item_sublabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="10dp" - android:layout_marginEnd="10dp" - android:textSize="14sp" - android:textColor="#8b8b8b" - android:ellipsize="end" - android:singleLine="true" - android:textAlignment="viewStart" - android:gravity="start" - android:includeFontPadding="false"/> - </LinearLayout> - - <ImageView - android:background="?android:attr/selectableItemBackground" - android:id="@+id/suggestion_item_arrow" - android:layout_width="50dp" - android:layout_height="match_parent" - android:gravity="end" - android:scaleType="center" - android:src="@drawable/suggestion_arrow" - android:contentDescription="@null" /> -</LinearLayout> - diff --git a/chrome/android/shell/res/menu/chrome_shell_main_menu.xml b/chrome/android/shell/res/menu/chrome_shell_main_menu.xml deleted file mode 100644 index 595fcc2..0000000 --- a/chrome/android/shell/res/menu/chrome_shell_main_menu.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2013 The Chromium Authors. All rights reserved. - - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. ---> -<menu xmlns:android="http://schemas.android.com/apk/res/android" > - - <group - android:id="@+id/MAIN_MENU" - android:visible="false" > - <item android:title="@null"> - <menu> - <item - android:id="@+id/back_menu_id" - android:icon="@drawable/btn_back" - android:title="@string/accessibility_menu_back"/> - <item - android:id="@+id/forward_menu_id" - android:icon="@drawable/btn_forward" - android:title="@string/accessibility_menu_forward"/> - <item - android:id="@+id/bookmark_this_page_id" - android:icon="@drawable/btn_star" - android:title="@string/accessibility_menu_bookmark"/> - <item - android:id="@+id/info_menu_id" - android:icon="@drawable/btn_info" - android:title="@string/accessibility_menu_info"/> - </menu> - </item> - <item - android:id="@+id/new_tab_menu_id" - android:title="@string/accessibility_tabstrip_btn_new_tab"/> - <item - android:id="@+id/signin" - android:title="@string/signin_sign_in"/> - <item - android:id="@+id/print" - android:title="@string/print_menu"/> - <item - android:id="@+id/distill_page" - android:title="@string/distill_page_menu"/> - <item android:title="@null"> - <menu> - <item - android:id="@+id/share_menu_id" - android:title="@string/menu_share_page"/> - <item - android:id="@+id/direct_share_menu_id" - android:title="@null"/> - </menu> - </item> - <item - android:id="@+id/preferences" - android:title="@string/preferences"/> - </group> - -</menu> diff --git a/chrome/android/shell/res/mipmap-hdpi/app_icon.png b/chrome/android/shell/res/mipmap-hdpi/app_icon.png Binary files differdeleted file mode 100644 index 39b19f9..0000000 --- a/chrome/android/shell/res/mipmap-hdpi/app_icon.png +++ /dev/null diff --git a/chrome/android/shell/res/mipmap-mdpi/app_icon.png b/chrome/android/shell/res/mipmap-mdpi/app_icon.png Binary files differdeleted file mode 100644 index 6842d14..0000000 --- a/chrome/android/shell/res/mipmap-mdpi/app_icon.png +++ /dev/null diff --git a/chrome/android/shell/res/mipmap-xhdpi/app_icon.png b/chrome/android/shell/res/mipmap-xhdpi/app_icon.png Binary files differdeleted file mode 100644 index 6557b95..0000000 --- a/chrome/android/shell/res/mipmap-xhdpi/app_icon.png +++ /dev/null diff --git a/chrome/android/shell/res/mipmap-xxhdpi/app_icon.png b/chrome/android/shell/res/mipmap-xxhdpi/app_icon.png Binary files differdeleted file mode 100644 index a39b170..0000000 --- a/chrome/android/shell/res/mipmap-xxhdpi/app_icon.png +++ /dev/null diff --git a/chrome/android/shell/res/mipmap-xxxhdpi/app_icon.png b/chrome/android/shell/res/mipmap-xxxhdpi/app_icon.png Binary files differdeleted file mode 100644 index 26d5f34..0000000 --- a/chrome/android/shell/res/mipmap-xxxhdpi/app_icon.png +++ /dev/null diff --git a/chrome/android/shell/res/values-v17/styles.xml b/chrome/android/shell/res/values-v17/styles.xml deleted file mode 100644 index 755aeff..0000000 --- a/chrome/android/shell/res/values-v17/styles.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Copyright 2014 The Chromium Authors. All rights reserved. - - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. ---> - -<resources> - - <style name="MainTheme" parent="Theme.AppCompat.Light.NoActionBar"> - <item name="android:windowContentOverlay">@null</item> - <item name="android:windowActionBar">false</item> - <item name="android:windowNoTitle">true</item> - - <!-- colorPrimary is used for the default action bar background --> - <item name="colorPrimary">@color/material_deep_teal_200</item> - - <!-- colorPrimaryDark is used for the status bar --> - <item name="colorPrimaryDark">@color/material_deep_teal_500</item> - - <!-- Default TintedImageButton tint --> - <item name="tint">@color/dark_mode_tint</item> - </style> - -</resources> diff --git a/chrome/android/shell/res/values/strings.xml b/chrome/android/shell/res/values/strings.xml deleted file mode 100644 index 2bd7b5c..0000000 --- a/chrome/android/shell/res/values/strings.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved. - - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - --> - -<resources> - <string name="url_hint">Type URL Here</string> - <string name="print_menu">Print…</string> - <string name="signin_select_account">Select Account</string> - <string name="signin_no_account">There is no google account registered on this device.</string> - <string name="signin_sign_in">Sign in</string> - <string name="signin_cancel">Cancel</string> - <string name="signout_title">Do you want to sign out?</string> - <string name="signout_sign_out">Sign out</string> - <string name="signout_cancel">Cancel</string> - <string name="distill_page_menu">Distill page</string> - <string name="browser_process_initialization_failed">Initialization failed.</string> -</resources> diff --git a/chrome/android/shell/res/xml/chrome_shell_main_preferences.xml b/chrome/android/shell/res/xml/chrome_shell_main_preferences.xml deleted file mode 100644 index e20dcc6..0000000 --- a/chrome/android/shell/res/xml/chrome_shell_main_preferences.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2014 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. --> - -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> - <org.chromium.chrome.browser.preferences.SearchEnginePreference - android:key="search_engine" - android:title="@string/prefs_search_engine"/> - <Preference - android:fragment="org.chromium.chrome.browser.preferences.autofill.AutofillPreferences" - android:title="@string/prefs_autofill" /> - <Preference - android:fragment="org.chromium.chrome.browser.preferences.password.SavePasswordsPreferences" - android:title="@string/prefs_saved_passwords" /> - <Preference - android:fragment="org.chromium.chrome.browser.preferences.AccessibilityPreferences" - android:title="@string/prefs_accessibility" /> - <Preference - android:fragment="org.chromium.chrome.browser.preferences.website.SiteSettingsPreferences" - android:title="@string/prefs_site_settings" /> - <Preference - android:fragment="org.chromium.chrome.browser.preferences.AboutChromePreferences" - android:title="@string/prefs_about_chrome" /> -</PreferenceScreen> diff --git a/chrome/android/shell/res/xml/syncadapter.xml b/chrome/android/shell/res/xml/syncadapter.xml deleted file mode 100644 index 87241a2..0000000 --- a/chrome/android/shell/res/xml/syncadapter.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- The attributes in this XML file provide configuration information --> -<!-- for the SyncAdapter. --> - -<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" - android:contentAuthority="org.chromium.chrome.shell" - android:accountType="com.google" -/> |