Java Code Examples for org.chromium.content.browser.DeviceUtils#addDeviceSpecificUserAgentSwitch()
The following examples show how to use
org.chromium.content.browser.DeviceUtils#addDeviceSpecificUserAgentSwitch() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChromeBrowserInitializer.java From delion with Apache License 2.0 | 6 votes |
private void preInflationStartup() { ThreadUtils.assertOnUiThread(); if (mPreInflationStartupComplete) return; PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, mApplication); // Ensure critical files are available, so they aren't blocked on the file-system // behind long-running accesses in next phase. // Don't do any large file access here! ContentApplication.initCommandLine(mApplication); waitForDebuggerIfNeeded(); ChromeStrictMode.configureStrictMode(); if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_WEBAPK)) { ChromeWebApkHost.init(); } warmUpSharedPrefs(); DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication); ApplicationStatus.registerStateListenerForAllActivities( createActivityStateListener()); mPreInflationStartupComplete = true; }
Example 2
Source File: ChromeBrowserInitializer.java From AndroidChromium with Apache License 2.0 | 6 votes |
private void preInflationStartup() { ThreadUtils.assertOnUiThread(); if (mPreInflationStartupComplete) return; PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); // Ensure critical files are available, so they aren't blocked on the file-system // behind long-running accesses in next phase. // Don't do any large file access here! ContentApplication.initCommandLine(mApplication); waitForDebuggerIfNeeded(); ChromeStrictMode.configureStrictMode(); ChromeWebApkHost.init(); warmUpSharedPrefs(); DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication); ApplicationStatus.registerStateListenerForAllActivities( createActivityStateListener()); mPreInflationStartupComplete = true; }
Example 3
Source File: ChromeBrowserInitializer.java From 365browser with Apache License 2.0 | 6 votes |
private void preInflationStartup() { ThreadUtils.assertOnUiThread(); if (mPreInflationStartupComplete) return; PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); // Ensure critical files are available, so they aren't blocked on the file-system // behind long-running accesses in next phase. // Don't do any large file access here! ContentApplication.initCommandLine(mApplication); waitForDebuggerIfNeeded(); ChromeStrictMode.configureStrictMode(); ChromeWebApkHost.init(); warmUpSharedPrefs(); DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication); ApplicationStatus.registerStateListenerForAllActivities( createActivityStateListener()); mPreInflationStartupComplete = true; }
Example 4
Source File: ChromiumTestShellActivity.java From android-chromium with BSD 2-Clause "Simplified" License | 5 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); ChromiumTestShellApplication.initCommandLine(); waitForDebuggerIfNeeded(); DeviceUtils.addDeviceSpecificUserAgentSwitch(this); BrowserStartupController.StartupCallback callback = new BrowserStartupController.StartupCallback() { @Override public void onSuccess(boolean alreadyStarted) { finishInitialization(savedInstanceState); } @Override public void onFailure() { Toast.makeText(ChromiumTestShellActivity.this, R.string.browser_process_initialization_failed, Toast.LENGTH_SHORT).show(); Log.e(TAG, "Chromium browser process initialization failed"); finish(); } }; BrowserStartupController.get(this).startBrowserProcessesAsync(callback); }
Example 5
Source File: ChromiumTestShellActivity.java From android-chromium with BSD 2-Clause "Simplified" License | 5 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); ChromiumTestShellApplication.initCommandLine(); waitForDebuggerIfNeeded(); DeviceUtils.addDeviceSpecificUserAgentSwitch(this); BrowserStartupController.StartupCallback callback = new BrowserStartupController.StartupCallback() { @Override public void onSuccess(boolean alreadyStarted) { finishInitialization(savedInstanceState); } @Override public void onFailure() { Toast.makeText(ChromiumTestShellActivity.this, R.string.browser_process_initialization_failed, Toast.LENGTH_SHORT).show(); Log.e(TAG, "Chromium browser process initialization failed"); finish(); } }; BrowserStartupController.get(this).startBrowserProcessesAsync(callback); }
Example 6
Source File: ContentShellActivity.java From android-chromium with BSD 2-Clause "Simplified" License | 4 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Initializing the command line must occur before loading the library. if (!CommandLine.isInitialized()) { CommandLine.initFromFile(COMMAND_LINE_FILE); String[] commandLineParams = getCommandLineParamsFromIntent(getIntent()); if (commandLineParams != null) { CommandLine.getInstance().appendSwitchesAndArguments(commandLineParams); } } waitForDebuggerIfNeeded(); DeviceUtils.addDeviceSpecificUserAgentSwitch(this); try { LibraryLoader.ensureInitialized(); } catch (ProcessInitException e) { Log.e(TAG, "ContentView initialization failed.", e); finish(); return; } setContentView(R.layout.content_shell_activity); mShellManager = (ShellManager) findViewById(R.id.shell_container); mWindowAndroid = new ActivityWindowAndroid(this); mWindowAndroid.restoreInstanceState(savedInstanceState); mShellManager.setWindow(mWindowAndroid); String startupUrl = getUrlFromIntent(getIntent()); if (!TextUtils.isEmpty(startupUrl)) { mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl)); } if (CommandLine.getInstance().hasSwitch(CommandLine.DUMP_RENDER_TREE)) { if(BrowserStartupController.get(this).startBrowserProcessesSync( BrowserStartupController.MAX_RENDERERS_LIMIT)) { finishInitialization(savedInstanceState); } else { initializationFailed(); } } else { BrowserStartupController.get(this).startBrowserProcessesAsync( new BrowserStartupController.StartupCallback() { @Override public void onSuccess(boolean alreadyStarted) { finishInitialization(savedInstanceState); } @Override public void onFailure() { initializationFailed(); } }); } }
Example 7
Source File: ContentShellActivity.java From android-chromium with BSD 2-Clause "Simplified" License | 4 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Initializing the command line must occur before loading the library. if (!CommandLine.isInitialized()) { CommandLine.initFromFile(COMMAND_LINE_FILE); String[] commandLineParams = getCommandLineParamsFromIntent(getIntent()); if (commandLineParams != null) { CommandLine.getInstance().appendSwitchesAndArguments(commandLineParams); } } waitForDebuggerIfNeeded(); DeviceUtils.addDeviceSpecificUserAgentSwitch(this); try { LibraryLoader.ensureInitialized(); } catch (ProcessInitException e) { Log.e(TAG, "ContentView initialization failed.", e); finish(); return; } setContentView(R.layout.content_shell_activity); mShellManager = (ShellManager) findViewById(R.id.shell_container); mWindowAndroid = new ActivityWindowAndroid(this); mWindowAndroid.restoreInstanceState(savedInstanceState); mShellManager.setWindow(mWindowAndroid); String startupUrl = getUrlFromIntent(getIntent()); if (!TextUtils.isEmpty(startupUrl)) { mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl)); } if (CommandLine.getInstance().hasSwitch(CommandLine.DUMP_RENDER_TREE)) { if(BrowserStartupController.get(this).startBrowserProcessesSync( BrowserStartupController.MAX_RENDERERS_LIMIT)) { finishInitialization(savedInstanceState); } else { initializationFailed(); } } else { BrowserStartupController.get(this).startBrowserProcessesAsync( new BrowserStartupController.StartupCallback() { @Override public void onSuccess(boolean alreadyStarted) { finishInitialization(savedInstanceState); } @Override public void onFailure() { initializationFailed(); } }); } }