OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content_shell_apk; | 5 package org.chromium.content_shell_apk; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.os.Bundle; | 9 import android.os.Bundle; |
10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 if (!CommandLine.isInitialized()) { | 53 if (!CommandLine.isInitialized()) { |
54 ContentApplication.initCommandLine(this); | 54 ContentApplication.initCommandLine(this); |
55 String[] commandLineParams = getCommandLineParamsFromIntent(getInten
t()); | 55 String[] commandLineParams = getCommandLineParamsFromIntent(getInten
t()); |
56 if (commandLineParams != null) { | 56 if (commandLineParams != null) { |
57 CommandLine.getInstance().appendSwitchesAndArguments(commandLine
Params); | 57 CommandLine.getInstance().appendSwitchesAndArguments(commandLine
Params); |
58 } | 58 } |
59 } | 59 } |
60 waitForDebuggerIfNeeded(); | 60 waitForDebuggerIfNeeded(); |
61 | 61 |
62 DeviceUtils.addDeviceSpecificUserAgentSwitch(this); | 62 DeviceUtils.addDeviceSpecificUserAgentSwitch(this); |
| 63 |
63 try { | 64 try { |
64 LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER) | 65 LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitiali
zed(); |
65 .ensureInitialized(getApplicationContext()); | |
66 } catch (ProcessInitException e) { | 66 } catch (ProcessInitException e) { |
67 Log.e(TAG, "ContentView initialization failed.", e); | 67 Log.e(TAG, "ContentView initialization failed.", e); |
68 // Since the library failed to initialize nothing in the application | 68 // Since the library failed to initialize nothing in the application |
69 // can work, so kill the whole application not just the activity | 69 // can work, so kill the whole application not just the activity |
70 System.exit(-1); | 70 System.exit(-1); |
71 return; | 71 return; |
72 } | 72 } |
73 | 73 |
74 setContentView(R.layout.content_shell_activity); | 74 setContentView(R.layout.content_shell_activity); |
75 mShellManager = (ShellManager) findViewById(R.id.shell_container); | 75 mShellManager = (ShellManager) findViewById(R.id.shell_container); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 /** | 256 /** |
257 * @return The {@link WebContents} owned by the currently visible {@link She
ll} or null if | 257 * @return The {@link WebContents} owned by the currently visible {@link She
ll} or null if |
258 * one is not showing. | 258 * one is not showing. |
259 */ | 259 */ |
260 public WebContents getActiveWebContents() { | 260 public WebContents getActiveWebContents() { |
261 Shell shell = getActiveShell(); | 261 Shell shell = getActiveShell(); |
262 return shell != null ? shell.getWebContents() : null; | 262 return shell != null ? shell.getWebContents() : null; |
263 } | 263 } |
264 | 264 |
265 } | 265 } |
OLD | NEW |