| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.tab; | 5 package org.chromium.chrome.browser.tab; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 import org.chromium.chrome.browser.crash.MinidumpUploadService; | 45 import org.chromium.chrome.browser.crash.MinidumpUploadService; |
| 46 import org.chromium.chrome.browser.document.DocumentUtils; | 46 import org.chromium.chrome.browser.document.DocumentUtils; |
| 47 import org.chromium.chrome.browser.dom_distiller.ReaderModeActivityDelegate; | 47 import org.chromium.chrome.browser.dom_distiller.ReaderModeActivityDelegate; |
| 48 import org.chromium.chrome.browser.dom_distiller.ReaderModeManager; | 48 import org.chromium.chrome.browser.dom_distiller.ReaderModeManager; |
| 49 import org.chromium.chrome.browser.download.ChromeDownloadDelegate; | 49 import org.chromium.chrome.browser.download.ChromeDownloadDelegate; |
| 50 import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler; | 50 import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler; |
| 51 import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler.Overrid
eUrlLoadingResult; | 51 import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler.Overrid
eUrlLoadingResult; |
| 52 import org.chromium.chrome.browser.externalnav.ExternalNavigationParams; | 52 import org.chromium.chrome.browser.externalnav.ExternalNavigationParams; |
| 53 import org.chromium.chrome.browser.fullscreen.FullscreenManager; | 53 import org.chromium.chrome.browser.fullscreen.FullscreenManager; |
| 54 import org.chromium.chrome.browser.media.MediaNotificationService; | 54 import org.chromium.chrome.browser.media.MediaNotificationService; |
| 55 import org.chromium.chrome.browser.media.ui.MediaSessionTabHelper; |
| 55 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; | 56 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; |
| 56 import org.chromium.chrome.browser.ntp.NativePageAssassin; | 57 import org.chromium.chrome.browser.ntp.NativePageAssassin; |
| 57 import org.chromium.chrome.browser.ntp.NativePageFactory; | 58 import org.chromium.chrome.browser.ntp.NativePageFactory; |
| 58 import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader; | 59 import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader; |
| 59 import org.chromium.chrome.browser.policy.PolicyAuditor; | 60 import org.chromium.chrome.browser.policy.PolicyAuditor; |
| 60 import org.chromium.chrome.browser.policy.PolicyAuditor.AuditEvent; | 61 import org.chromium.chrome.browser.policy.PolicyAuditor.AuditEvent; |
| 61 import org.chromium.chrome.browser.preferences.PrefServiceBridge; | 62 import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
| 62 import org.chromium.chrome.browser.rlz.RevenueStats; | 63 import org.chromium.chrome.browser.rlz.RevenueStats; |
| 63 import org.chromium.chrome.browser.search_engines.TemplateUrlService; | 64 import org.chromium.chrome.browser.search_engines.TemplateUrlService; |
| 64 import org.chromium.chrome.browser.tab.BackgroundContentViewHelper.BackgroundCon
tentViewDelegate; | 65 import org.chromium.chrome.browser.tab.BackgroundContentViewHelper.BackgroundCon
tentViewDelegate; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 92 | 93 |
| 93 import java.util.Locale; | 94 import java.util.Locale; |
| 94 | 95 |
| 95 /** | 96 /** |
| 96 * A representation of a Tab for Chrome. This manages wrapping a WebContents and
interacting with | 97 * A representation of a Tab for Chrome. This manages wrapping a WebContents and
interacting with |
| 97 * most of Chromium while representing a consistent version of web content to th
e front end. | 98 * most of Chromium while representing a consistent version of web content to th
e front end. |
| 98 */ | 99 */ |
| 99 public class ChromeTab extends Tab { | 100 public class ChromeTab extends Tab { |
| 100 public static final int NTP_TAB_ID = -2; | 101 public static final int NTP_TAB_ID = -2; |
| 101 | 102 |
| 102 private static final String TAG = "ChromeTab"; | 103 private static final String TAG = "cr.ChromeTab"; |
| 103 | 104 |
| 104 // URL didFailLoad error code. Should match the value in net_error_list.h. | 105 // URL didFailLoad error code. Should match the value in net_error_list.h. |
| 105 public static final int BLOCKED_BY_ADMINISTRATOR = -22; | 106 public static final int BLOCKED_BY_ADMINISTRATOR = -22; |
| 106 | 107 |
| 107 public static final String PAGESPEED_PASSTHROUGH_HEADERS = | 108 public static final String PAGESPEED_PASSTHROUGH_HEADERS = |
| 108 "Chrome-Proxy: pass-through\nCache-Control: no-cache"; | 109 "Chrome-Proxy: pass-through\nCache-Control: no-cache"; |
| 109 | 110 |
| 110 private static final int MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD = 1; | 111 private static final int MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD = 1; |
| 111 | 112 |
| 112 /** The maximum amount of time to wait for a page to load before entering fu
llscreen. -1 means | 113 /** The maximum amount of time to wait for a page to load before entering fu
llscreen. -1 means |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 CipherFactory.getInstance().triggerKeyGeneration(); | 249 CipherFactory.getInstance().triggerKeyGeneration(); |
| 249 } | 250 } |
| 250 | 251 |
| 251 mReaderModeManager = new ReaderModeManager(this, activity); | 252 mReaderModeManager = new ReaderModeManager(this, activity); |
| 252 RevenueStats.getInstance().tabCreated(this); | 253 RevenueStats.getInstance().tabCreated(this); |
| 253 | 254 |
| 254 mTabRedirectHandler = new TabRedirectHandler(activity); | 255 mTabRedirectHandler = new TabRedirectHandler(activity); |
| 255 | 256 |
| 256 ContextualSearchTabHelper.createForTab(this); | 257 ContextualSearchTabHelper.createForTab(this); |
| 257 if (nativeWindow != null) ThumbnailTabHelper.createForTab(this); | 258 if (nativeWindow != null) ThumbnailTabHelper.createForTab(this); |
| 259 MediaSessionTabHelper.createForTab(this); |
| 258 } | 260 } |
| 259 | 261 |
| 260 /** | 262 /** |
| 261 * Creates a minimal {@link ChromeTab} for testing. Do not use outside testi
ng. | 263 * Creates a minimal {@link ChromeTab} for testing. Do not use outside testi
ng. |
| 262 * | 264 * |
| 263 * @param id The id of the tab. | 265 * @param id The id of the tab. |
| 264 * @param incognito Whether the tab is incognito. | 266 * @param incognito Whether the tab is incognito. |
| 265 */ | 267 */ |
| 266 @VisibleForTesting | 268 @VisibleForTesting |
| 267 public ChromeTab(int id, boolean incognito) { | 269 public ChromeTab(int id, boolean incognito) { |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 didFinishPageLoad(); | 1472 didFinishPageLoad(); |
| 1471 } | 1473 } |
| 1472 } | 1474 } |
| 1473 }; | 1475 }; |
| 1474 | 1476 |
| 1475 @VisibleForTesting | 1477 @VisibleForTesting |
| 1476 public OverrideUrlLoadingResult getLastOverrideUrlLoadingResultForTests() { | 1478 public OverrideUrlLoadingResult getLastOverrideUrlLoadingResultForTests() { |
| 1477 return mLastOverrideUrlLoadingResult; | 1479 return mLastOverrideUrlLoadingResult; |
| 1478 } | 1480 } |
| 1479 } | 1481 } |
| OLD | NEW |