diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 00:11:40 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 00:11:40 +0000 |
commit | df1af24a4724624aa2b56c6adc0db49694379d25 (patch) | |
tree | 466cc885d6706d8d4bf8ed2485ca592646b68476 | |
parent | 49f3d5598a091569e15102770ffb1a50732d2fc4 (diff) | |
download | chromium_src-df1af24a4724624aa2b56c6adc0db49694379d25.zip chromium_src-df1af24a4724624aa2b56c6adc0db49694379d25.tar.gz chromium_src-df1af24a4724624aa2b56c6adc0db49694379d25.tar.bz2 |
Stop the location bar from flashing white when navigating from one HTTPS site to another. To do this, we have to make sure the SSLManager sees the DidCommitProvisionalLoad event before the location bar draws itself to the screen.
BUG=11157
TEST=Navigate from one HTTPS site to another and watch the location bar carefully. It shouln't flash anymore.
Review URL: http://codereview.chromium.org/99247
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15020 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ssl/ssl_manager.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_manager.h | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.cc | 12 |
3 files changed, 15 insertions, 8 deletions
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc index afc48ce..3ff1385 100644 --- a/chrome/browser/ssl/ssl_manager.cc +++ b/chrome/browser/ssl/ssl_manager.cc @@ -111,8 +111,6 @@ SSLManager::SSLManager(NavigationController* controller, Delegate* delegate) delegate_ = SSLPolicy::GetDefaultPolicy(); // Subscribe to various notifications. - registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, - Source<NavigationController>(controller_)); registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, Source<NavigationController>(controller_)); registrar_.Add(this, NotificationType::RESOURCE_RESPONSE_STARTED, @@ -530,9 +528,6 @@ void SSLManager::Observe(NotificationType type, const NotificationDetails& details) { // Dispatch by type. switch (type.value) { - case NotificationType::NAV_ENTRY_COMMITTED: - DidCommitProvisionalLoad(details); - break; case NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR: DidFailProvisionalLoadWithError( Details<ProvisionalLoadDetails>(details).ptr()); diff --git a/chrome/browser/ssl/ssl_manager.h b/chrome/browser/ssl/ssl_manager.h index d477e36..8ad8a6a 100644 --- a/chrome/browser/ssl/ssl_manager.h +++ b/chrome/browser/ssl/ssl_manager.h @@ -445,6 +445,11 @@ class SSLManager : public NotificationObserver { const NotificationSource& source, const NotificationDetails& details); + // This entry point is called directly (instead of via the notification + // service) because we need more precise control of the order in which folks + // are notified of this event. + void DidCommitProvisionalLoad(const NotificationDetails& details); + // Called to determine if there were any processed SSL errors from request. bool ProcessedSSLErrorFromRequest() const; @@ -498,7 +503,6 @@ class SSLManager : public NotificationObserver { // the type we need is in NavigationController which would create a circular // header file dependency. void DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details); - void DidCommitProvisionalLoad(const NotificationDetails& details); void DidFailProvisionalLoadWithError(ProvisionalLoadDetails* details); void DidStartResourceResponse(ResourceRequestDetails* details); void DidReceiveResourceRedirect(ResourceRedirectDetails* details); diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 268eadb..d8aca75 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -865,17 +865,25 @@ void NavigationController::NavigateToPendingEntry(bool reload) { void NavigationController::NotifyNavigationEntryCommitted( LoadCommittedDetails* details) { + details->entry = GetActiveEntry(); + NotificationDetails notification_details = + Details<LoadCommittedDetails>(details); + + // We need to notify the ssl_manager_ before the tab_contents_ so the + // location bar will have up-to-date information about the security style + // when it wants to draw. See http://crbug.com/11157 + ssl_manager_.DidCommitProvisionalLoad(notification_details); + // TODO(pkasting): http://b/1113079 Probably these explicit notification paths // should be removed, and interested parties should just listen for the // notification below instead. tab_contents_->NotifyNavigationStateChanged( TabContents::INVALIDATE_EVERYTHING); - details->entry = GetActiveEntry(); NotificationService::current()->Notify( NotificationType::NAV_ENTRY_COMMITTED, Source<NavigationController>(this), - Details<LoadCommittedDetails>(details)); + notification_details); } // static |