Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.res.Resources; | 10 import android.content.res.Resources; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 import org.chromium.chrome.browser.NativePage; | 40 import org.chromium.chrome.browser.NativePage; |
| 41 import org.chromium.chrome.browser.SwipeRefreshHandler; | 41 import org.chromium.chrome.browser.SwipeRefreshHandler; |
| 42 import org.chromium.chrome.browser.TabState; | 42 import org.chromium.chrome.browser.TabState; |
| 43 import org.chromium.chrome.browser.TabState.WebContentsState; | 43 import org.chromium.chrome.browser.TabState.WebContentsState; |
| 44 import org.chromium.chrome.browser.UrlConstants; | 44 import org.chromium.chrome.browser.UrlConstants; |
| 45 import org.chromium.chrome.browser.WebContentsFactory; | 45 import org.chromium.chrome.browser.WebContentsFactory; |
| 46 import org.chromium.chrome.browser.banners.AppBannerManager; | 46 import org.chromium.chrome.browser.banners.AppBannerManager; |
| 47 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; | 47 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; |
| 48 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; | 48 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; |
| 49 import org.chromium.chrome.browser.contextualsearch.ContextualSearchTabHelper; | 49 import org.chromium.chrome.browser.contextualsearch.ContextualSearchTabHelper; |
| 50 import org.chromium.chrome.browser.crash.MinidumpDirectoryObserver; | |
| 50 import org.chromium.chrome.browser.crash.MinidumpUploadService; | 51 import org.chromium.chrome.browser.crash.MinidumpUploadService; |
| 51 import org.chromium.chrome.browser.customtabs.CustomTabActivity; | 52 import org.chromium.chrome.browser.customtabs.CustomTabActivity; |
| 52 import org.chromium.chrome.browser.download.ChromeDownloadDelegate; | 53 import org.chromium.chrome.browser.download.ChromeDownloadDelegate; |
| 53 import org.chromium.chrome.browser.enhancedbookmarks.EnhancedBookmarkUtils; | 54 import org.chromium.chrome.browser.enhancedbookmarks.EnhancedBookmarkUtils; |
| 54 import org.chromium.chrome.browser.fullscreen.FullscreenManager; | 55 import org.chromium.chrome.browser.fullscreen.FullscreenManager; |
| 55 import org.chromium.chrome.browser.help.HelpAndFeedback; | 56 import org.chromium.chrome.browser.help.HelpAndFeedback; |
| 56 import org.chromium.chrome.browser.infobar.InfoBarContainer; | 57 import org.chromium.chrome.browser.infobar.InfoBarContainer; |
| 57 import org.chromium.chrome.browser.media.ui.MediaSessionTabHelper; | 58 import org.chromium.chrome.browser.media.ui.MediaSessionTabHelper; |
| 58 import org.chromium.chrome.browser.ntp.NativePageAssassin; | 59 import org.chromium.chrome.browser.ntp.NativePageAssassin; |
| 59 import org.chromium.chrome.browser.ntp.NativePageFactory; | 60 import org.chromium.chrome.browser.ntp.NativePageFactory; |
| 60 import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader; | 61 import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader; |
| 61 import org.chromium.chrome.browser.policy.PolicyAuditor; | 62 import org.chromium.chrome.browser.policy.PolicyAuditor; |
| 62 import org.chromium.chrome.browser.printing.TabPrinter; | 63 import org.chromium.chrome.browser.printing.TabPrinter; |
| 63 import org.chromium.chrome.browser.profiles.Profile; | 64 import org.chromium.chrome.browser.profiles.Profile; |
| 64 import org.chromium.chrome.browser.rlz.RevenueStats; | 65 import org.chromium.chrome.browser.rlz.RevenueStats; |
| 65 import org.chromium.chrome.browser.search_engines.TemplateUrlService; | 66 import org.chromium.chrome.browser.search_engines.TemplateUrlService; |
| 66 import org.chromium.chrome.browser.snackbar.LoFiBarPopupController; | 67 import org.chromium.chrome.browser.snackbar.LoFiBarPopupController; |
| 67 import org.chromium.chrome.browser.snackbar.SnackbarManager; | 68 import org.chromium.chrome.browser.snackbar.SnackbarManager; |
| 68 import org.chromium.chrome.browser.ssl.SecurityStateModel; | 69 import org.chromium.chrome.browser.ssl.SecurityStateModel; |
| 69 import org.chromium.chrome.browser.tab.TabUma.TabCreationState; | 70 import org.chromium.chrome.browser.tab.TabUma.TabCreationState; |
| 70 import org.chromium.chrome.browser.tabmodel.SingleTabModelSelector; | 71 import org.chromium.chrome.browser.tabmodel.SingleTabModelSelector; |
| 71 import org.chromium.chrome.browser.tabmodel.TabModel; | 72 import org.chromium.chrome.browser.tabmodel.TabModel; |
| 72 import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; | 73 import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; |
| 73 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; | 74 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; |
| 74 import org.chromium.chrome.browser.tabmodel.TabModelImpl; | 75 import org.chromium.chrome.browser.tabmodel.TabModelImpl; |
| 75 import org.chromium.chrome.browser.tabmodel.TabModelSelector; | 76 import org.chromium.chrome.browser.tabmodel.TabModelSelector; |
| 76 import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; | 77 import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; |
| 77 import org.chromium.components.navigation_interception.InterceptNavigationDelega te; | 78 import org.chromium.components.navigation_interception.InterceptNavigationDelega te; |
| 78 import org.chromium.components.security_state.ConnectionSecurityLevel; | 79 import org.chromium.components.security_state.ConnectionSecurityLevel; |
| 80 import org.chromium.components.variations.VariationsAssociatedData; | |
| 79 import org.chromium.content.browser.ActivityContentVideoViewEmbedder; | 81 import org.chromium.content.browser.ActivityContentVideoViewEmbedder; |
| 80 import org.chromium.content.browser.ContentVideoViewEmbedder; | 82 import org.chromium.content.browser.ContentVideoViewEmbedder; |
| 81 import org.chromium.content.browser.ContentView; | 83 import org.chromium.content.browser.ContentView; |
| 82 import org.chromium.content.browser.ContentViewClient; | 84 import org.chromium.content.browser.ContentViewClient; |
| 83 import org.chromium.content.browser.ContentViewCore; | 85 import org.chromium.content.browser.ContentViewCore; |
| 84 import org.chromium.content.browser.crypto.CipherFactory; | 86 import org.chromium.content.browser.crypto.CipherFactory; |
| 85 import org.chromium.content_public.browser.GestureStateListener; | 87 import org.chromium.content_public.browser.GestureStateListener; |
| 86 import org.chromium.content_public.browser.LoadUrlParams; | 88 import org.chromium.content_public.browser.LoadUrlParams; |
| 87 import org.chromium.content_public.browser.WebContents; | 89 import org.chromium.content_public.browser.WebContents; |
| 88 import org.chromium.content_public.common.Referrer; | 90 import org.chromium.content_public.common.Referrer; |
| (...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2455 | 2457 |
| 2456 /** | 2458 /** |
| 2457 * Performs any subclass-specific tasks when the Tab crashes. | 2459 * Performs any subclass-specific tasks when the Tab crashes. |
| 2458 */ | 2460 */ |
| 2459 void handleTabCrash() { | 2461 void handleTabCrash() { |
| 2460 mIsLoading = false; | 2462 mIsLoading = false; |
| 2461 mIsBeingRestored = false; | 2463 mIsBeingRestored = false; |
| 2462 | 2464 |
| 2463 if (mTabUma != null) mTabUma.onRendererCrashed(); | 2465 if (mTabUma != null) mTabUma.onRendererCrashed(); |
| 2464 | 2466 |
| 2465 try { | 2467 if (TextUtils.equals("false", VariationsAssociatedData.getVariationParam Value( |
|
Yaron
2016/02/01 20:22:40
I don't think this is right - the function said it
Yaron
2016/02/03 21:51:42
I don't see this addressed
Menglin
2016/02/04 00:17:23
Yes. You are right.
| |
| 2466 // Update the most recent minidump file with the logcat. Doing this asynchronously | 2468 MinidumpDirectoryObserver.MINIDUMP_EXPERIMENT_NAME, "Enabled"))) { |
| 2467 // adds a race condition in the case of multiple simultaneously rend erer crashses | 2469 try { |
| 2468 // but because the data will be the same for all of them it is innoc uous. We can | 2470 // Update the most recent minidump file with the logcat. Doing t his asynchronously |
| 2469 // attempt to do this regardless of whether it was a foreground tab in the event | 2471 // adds a race condition in the case of multiple simultaneously renderer crashses |
| 2470 // that it's a real crash and not just android killing the tab. | 2472 // but because the data will be the same for all of them it is i nnocuous. We can |
| 2471 Context context = getApplicationContext(); | 2473 // attempt to do this regardless of whether it was a foreground tab in the event |
| 2472 Intent intent = MinidumpUploadService.createFindAndUploadLastCrashIn tent(context); | 2474 // that it's a real crash and not just android killing the tab. |
| 2473 context.startService(intent); | 2475 Context context = getApplicationContext(); |
| 2474 RecordUserAction.record("MobileBreakpadUploadAttempt"); | 2476 Intent intent = MinidumpUploadService.createFindAndUploadLastCra shIntent(context); |
| 2475 } catch (SecurityException e) { | 2477 context.startService(intent); |
| 2476 // For KitKat and below, there was a framework bug which cause us to not be able to | 2478 RecordUserAction.record("MobileBreakpadUploadAttempt"); |
| 2477 // find our own crash uploading service. Ignore a SecurityException here on older | 2479 } catch (SecurityException e) { |
| 2478 // OS versions since the crash will eventually get uploaded on next start. crbug/542533 | 2480 // For KitKat and below, there was a framework bug which cause u s to not be able to |
| 2479 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | 2481 // find our own crash uploading service. Ignore a SecurityExcept ion here on older |
| 2480 throw e; | 2482 // OS versions since the crash will eventually get uploaded on n ext start. |
| 2483 // crbug/542533 | |
| 2484 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
| 2485 throw e; | |
| 2486 } | |
| 2481 } | 2487 } |
| 2482 } | 2488 } |
| 2483 } | 2489 } |
| 2484 | 2490 |
| 2485 /** | 2491 /** |
| 2486 * @return Whether showing top controls is enabled or not. | 2492 * @return Whether showing top controls is enabled or not. |
| 2487 */ | 2493 */ |
| 2488 public boolean isShowingTopControlsEnabled() { | 2494 public boolean isShowingTopControlsEnabled() { |
| 2489 return mTopControlsVisibilityDelegate.isShowingTopControlsEnabled(); | 2495 return mTopControlsVisibilityDelegate.isShowingTopControlsEnabled(); |
| 2490 } | 2496 } |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2912 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id, | 2918 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id, |
| 2913 InterceptNavigationDelegate delegate); | 2919 InterceptNavigationDelegate delegate); |
| 2914 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 2920 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
| 2915 TabContentManager tabContentManager); | 2921 TabContentManager tabContentManager); |
| 2916 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , | 2922 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , |
| 2917 ContentViewCore content, boolean visible); | 2923 ContentViewCore content, boolean visible); |
| 2918 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , | 2924 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , |
| 2919 ContentViewCore content); | 2925 ContentViewCore content); |
| 2920 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); | 2926 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); |
| 2921 } | 2927 } |
| OLD | NEW |