Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1310)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

Issue 1314843007: Refactor connection_security into SecurityStateModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: palmer comments #2 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulatorWrapper; 50 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulatorWrapper;
51 import org.chromium.chrome.browser.contextmenu.EmptyChromeContextMenuItemDelegat e; 51 import org.chromium.chrome.browser.contextmenu.EmptyChromeContextMenuItemDelegat e;
52 import org.chromium.chrome.browser.fullscreen.FullscreenManager; 52 import org.chromium.chrome.browser.fullscreen.FullscreenManager;
53 import org.chromium.chrome.browser.help.HelpAndFeedback; 53 import org.chromium.chrome.browser.help.HelpAndFeedback;
54 import org.chromium.chrome.browser.infobar.InfoBarContainer; 54 import org.chromium.chrome.browser.infobar.InfoBarContainer;
55 import org.chromium.chrome.browser.metrics.UmaSessionStats; 55 import org.chromium.chrome.browser.metrics.UmaSessionStats;
56 import org.chromium.chrome.browser.metrics.UmaUtils; 56 import org.chromium.chrome.browser.metrics.UmaUtils;
57 import org.chromium.chrome.browser.printing.TabPrinter; 57 import org.chromium.chrome.browser.printing.TabPrinter;
58 import org.chromium.chrome.browser.profiles.Profile; 58 import org.chromium.chrome.browser.profiles.Profile;
59 import org.chromium.chrome.browser.snackbar.SnackbarManager; 59 import org.chromium.chrome.browser.snackbar.SnackbarManager;
60 import org.chromium.chrome.browser.ssl.ConnectionSecurity;
61 import org.chromium.chrome.browser.ssl.ConnectionSecurityLevel; 60 import org.chromium.chrome.browser.ssl.ConnectionSecurityLevel;
61 import org.chromium.chrome.browser.ssl.SecurityStateModel;
62 import org.chromium.chrome.browser.tab.TabUma.TabCreationState; 62 import org.chromium.chrome.browser.tab.TabUma.TabCreationState;
63 import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; 63 import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
64 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; 64 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType;
65 import org.chromium.chrome.browser.tabmodel.TabModelBase; 65 import org.chromium.chrome.browser.tabmodel.TabModelBase;
66 import org.chromium.chrome.browser.tabmodel.TabModelSelector; 66 import org.chromium.chrome.browser.tabmodel.TabModelSelector;
67 import org.chromium.chrome.browser.util.FeatureUtilities; 67 import org.chromium.chrome.browser.util.FeatureUtilities;
68 import org.chromium.components.navigation_interception.InterceptNavigationDelega te; 68 import org.chromium.components.navigation_interception.InterceptNavigationDelega te;
69 import org.chromium.content.browser.ContentView; 69 import org.chromium.content.browser.ContentView;
70 import org.chromium.content.browser.ContentViewClient; 70 import org.chromium.content.browser.ContentViewClient;
71 import org.chromium.content.browser.ContentViewCore; 71 import org.chromium.content.browser.ContentViewCore;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // Update cached title then notify observers. 452 // Update cached title then notify observers.
453 updateTitle(); 453 updateTitle();
454 } 454 }
455 if ((flags & InvalidateTypes.URL) != 0) { 455 if ((flags & InvalidateTypes.URL) != 0) {
456 for (TabObserver observer : mObservers) observer.onUrlUpdated(Ta b.this); 456 for (TabObserver observer : mObservers) observer.onUrlUpdated(Ta b.this);
457 } 457 }
458 } 458 }
459 459
460 @Override 460 @Override
461 public void visibleSSLStateChanged() { 461 public void visibleSSLStateChanged() {
462 SecurityStateModel.securityStateChanged(getWebContents());
462 for (TabObserver observer : mObservers) observer.onSSLStateUpdated(T ab.this); 463 for (TabObserver observer : mObservers) observer.onSSLStateUpdated(T ab.this);
463 } 464 }
464 465
465 @Override 466 @Override
466 public void webContentsCreated(WebContents sourceWebContents, long opene rRenderFrameId, 467 public void webContentsCreated(WebContents sourceWebContents, long opene rRenderFrameId,
467 String frameName, String targetUrl, WebContents newWebContents) { 468 String frameName, String targetUrl, WebContents newWebContents) {
468 for (TabObserver observer : mObservers) { 469 for (TabObserver observer : mObservers) {
469 observer.webContentsCreated(Tab.this, sourceWebContents, openerR enderFrameId, 470 observer.webContentsCreated(Tab.this, sourceWebContents, openerR enderFrameId,
470 frameName, targetUrl, newWebContents); 471 frameName, targetUrl, newWebContents);
471 } 472 }
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 public boolean getUseDesktopUserAgent() { 1212 public boolean getUseDesktopUserAgent() {
1212 return getWebContents() != null && getWebContents().getNavigationControl ler() 1213 return getWebContents() != null && getWebContents().getNavigationControl ler()
1213 .getUseDesktopUserAgent(); 1214 .getUseDesktopUserAgent();
1214 } 1215 }
1215 1216
1216 /** 1217 /**
1217 * @return The current {@link ConnectionSecurityLevel} for the tab. 1218 * @return The current {@link ConnectionSecurityLevel} for the tab.
1218 */ 1219 */
1219 // TODO(tedchoc): Remove this and transition all clients to use ToolbarModel directly. 1220 // TODO(tedchoc): Remove this and transition all clients to use ToolbarModel directly.
1220 public int getSecurityLevel() { 1221 public int getSecurityLevel() {
1221 return ConnectionSecurity.getSecurityLevelForWebContents(getWebContents( )); 1222 return SecurityStateModel.getSecurityLevelForWebContents(getWebContents( ));
1222 } 1223 }
1223 1224
1224 /** 1225 /**
1225 * @return The sync id of the tab if session sync is enabled, {@code 0} othe rwise. 1226 * @return The sync id of the tab if session sync is enabled, {@code 0} othe rwise.
1226 */ 1227 */
1227 @CalledByNative 1228 @CalledByNative
1228 protected int getSyncId() { 1229 protected int getSyncId() {
1229 return mSyncId; 1230 return mSyncId;
1230 } 1231 }
1231 1232
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2868 private native void nativeAttachToTabContentManager(long nativeTabAndroid, 2869 private native void nativeAttachToTabContentManager(long nativeTabAndroid,
2869 TabContentManager tabContentManager); 2870 TabContentManager tabContentManager);
2870 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , 2871 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid ,
2871 ContentViewCore content, boolean visible); 2872 ContentViewCore content, boolean visible);
2872 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , 2873 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid ,
2873 ContentViewCore content); 2874 ContentViewCore content);
2874 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); 2875 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url);
2875 2876
2876 private static native void nativeRecordStartupToCommitUma(); 2877 private static native void nativeRecordStartupToCommitUma();
2877 } 2878 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698