OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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; | 5 package org.chromium.content_shell; |
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; |
11 import android.util.Log; | 11 import android.util.Log; |
12 import android.view.KeyEvent; | 12 import android.view.KeyEvent; |
13 | 13 |
14 import org.chromium.content.app.LibraryLoader; | 14 import org.chromium.content.app.LibraryLoader; |
| 15 import org.chromium.content.browser.ActivityContentVideoViewDelegate; |
15 import org.chromium.content.browser.ContentVideoView; | 16 import org.chromium.content.browser.ContentVideoView; |
16 import org.chromium.content.browser.ContentView; | 17 import org.chromium.content.browser.ContentView; |
17 import org.chromium.content.browser.DeviceUtils; | 18 import org.chromium.content.browser.DeviceUtils; |
18 import org.chromium.content.common.CommandLine; | 19 import org.chromium.content.common.CommandLine; |
19 import org.chromium.ui.gfx.ActivityNativeWindow; | 20 import org.chromium.ui.gfx.ActivityNativeWindow; |
20 | 21 |
21 /** | 22 /** |
22 * Activity for managing the Content Shell. | 23 * Activity for managing the Content Shell. |
23 */ | 24 */ |
24 public class ContentShellActivity extends Activity { | 25 public class ContentShellActivity extends Activity { |
(...skipping 24 matching lines...) Expand all Loading... |
49 | 50 |
50 DeviceUtils.addDeviceSpecificUserAgentSwitch(this); | 51 DeviceUtils.addDeviceSpecificUserAgentSwitch(this); |
51 | 52 |
52 LibraryLoader.ensureInitialized(); | 53 LibraryLoader.ensureInitialized(); |
53 | 54 |
54 setContentView(R.layout.content_shell_activity); | 55 setContentView(R.layout.content_shell_activity); |
55 mShellManager = (ShellManager) findViewById(R.id.shell_container); | 56 mShellManager = (ShellManager) findViewById(R.id.shell_container); |
56 mActivityNativeWindow = new ActivityNativeWindow(this); | 57 mActivityNativeWindow = new ActivityNativeWindow(this); |
57 mActivityNativeWindow.restoreInstanceState(savedInstanceState); | 58 mActivityNativeWindow.restoreInstanceState(savedInstanceState); |
58 mShellManager.setWindow(mActivityNativeWindow); | 59 mShellManager.setWindow(mActivityNativeWindow); |
59 ContentVideoView.registerChromeActivity(this); | 60 ContentVideoView.registerContentVideoViewContextDelegate( |
| 61 new ActivityContentVideoViewDelegate(this)); |
60 | 62 |
61 String startupUrl = getUrlFromIntent(getIntent()); | 63 String startupUrl = getUrlFromIntent(getIntent()); |
62 if (!TextUtils.isEmpty(startupUrl)) { | 64 if (!TextUtils.isEmpty(startupUrl)) { |
63 mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl)); | 65 mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl)); |
64 } | 66 } |
65 | 67 |
66 if (!ContentView.enableMultiProcess(this, ContentView.MAX_RENDERERS_AUTO
MATIC)) { | 68 if (!ContentView.enableMultiProcess(this, ContentView.MAX_RENDERERS_AUTO
MATIC)) { |
67 String shellUrl = DEFAULT_SHELL_URL; | 69 String shellUrl = DEFAULT_SHELL_URL; |
68 if (savedInstanceState != null | 70 if (savedInstanceState != null |
69 && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) { | 71 && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 169 |
168 /** | 170 /** |
169 * @return The {@link ContentView} owned by the currently visible {@link She
ll} or null if one | 171 * @return The {@link ContentView} owned by the currently visible {@link She
ll} or null if one |
170 * is not showing. | 172 * is not showing. |
171 */ | 173 */ |
172 public ContentView getActiveContentView() { | 174 public ContentView getActiveContentView() { |
173 Shell shell = getActiveShell(); | 175 Shell shell = getActiveShell(); |
174 return shell != null ? shell.getContentView() : null; | 176 return shell != null ? shell.getContentView() : null; |
175 } | 177 } |
176 } | 178 } |
OLD | NEW |