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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 CommandLine.initFromFile(COMMAND_LINE_FILE); | 49 CommandLine.initFromFile(COMMAND_LINE_FILE); |
50 String[] commandLineParams = getCommandLineParamsFromIntent(getInten
t()); | 50 String[] commandLineParams = getCommandLineParamsFromIntent(getInten
t()); |
51 if (commandLineParams != null) { | 51 if (commandLineParams != null) { |
52 CommandLine.getInstance().appendSwitchesAndArguments(commandLine
Params); | 52 CommandLine.getInstance().appendSwitchesAndArguments(commandLine
Params); |
53 } | 53 } |
54 } | 54 } |
55 waitForDebuggerIfNeeded(); | 55 waitForDebuggerIfNeeded(); |
56 | 56 |
57 DeviceUtils.addDeviceSpecificUserAgentSwitch(this); | 57 DeviceUtils.addDeviceSpecificUserAgentSwitch(this); |
58 try { | 58 try { |
59 LibraryLoader.ensureInitialized(null); | 59 LibraryLoader.ensureInitialized(); |
60 } catch (ProcessInitException e) { | 60 } catch (ProcessInitException e) { |
61 Log.e(TAG, "ContentView initialization failed.", e); | 61 Log.e(TAG, "ContentView initialization failed.", e); |
62 // Since the library failed to initialize nothing in the application | 62 // Since the library failed to initialize nothing in the application |
63 // can work, so kill the whole application not just the activity | 63 // can work, so kill the whole application not just the activity |
64 System.exit(-1); | 64 System.exit(-1); |
65 return; | 65 return; |
66 } | 66 } |
67 | 67 |
68 setContentView(R.layout.content_shell_activity); | 68 setContentView(R.layout.content_shell_activity); |
69 mShellManager = (ShellManager) findViewById(R.id.shell_container); | 69 mShellManager = (ShellManager) findViewById(R.id.shell_container); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 /** | 219 /** |
220 * @return The {@link ContentView} owned by the currently visible {@link She
ll} or null if one | 220 * @return The {@link ContentView} owned by the currently visible {@link She
ll} or null if one |
221 * is not showing. | 221 * is not showing. |
222 */ | 222 */ |
223 public ContentView getActiveContentView() { | 223 public ContentView getActiveContentView() { |
224 Shell shell = getActiveShell(); | 224 Shell shell = getActiveShell(); |
225 return shell != null ? shell.getContentView() : null; | 225 return shell != null ? shell.getContentView() : null; |
226 } | 226 } |
227 } | 227 } |
OLD | NEW |