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

Unified Diff: chrome/browser/ui/browser.cc

Issue 12220100: Revert "content: convert SSL notifications to observer usage" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | content/browser/ssl/ssl_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 8a3841f1ac093b412b937fbcd1b449b73fb6a6d3..1e36475c350b28db8a1a8743fd5d8737fc30418f 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -374,6 +374,8 @@ Browser::Browser(const CreateParams& params)
new chrome::search::SearchDelegate(search_model_.get(),
toolbar_model_.get()));
+ registrar_.Add(this, content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
+ content::NotificationService::AllSources());
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
content::Source<Profile>(profile_->GetOriginalProfile()));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
@@ -752,14 +754,6 @@ void Browser::WindowFullscreenStateChanged() {
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
}
-void Browser::VisibleSSLStateChanged(content::WebContents* web_contents) {
- // When the current tab's SSL state changes, we need to update the URL
- // bar to reflect the new state.
- DCHECK(web_contents);
- if (tab_strip_model_->GetActiveWebContents() == web_contents)
- UpdateToolbar(false);
-}
-
///////////////////////////////////////////////////////////////////////////////
// Browser, Assorted browser commands:
@@ -1762,6 +1756,19 @@ void Browser::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
+ case content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED:
+ // When the current tab's SSL state changes, we need to update the URL
+ // bar to reflect the new state. Note that it's possible for the selected
+ // tab contents to be NULL. This is because we listen for all sources
+ // (NavigationControllers) for convenience, so the notification could
+ // actually be for a different window while we're doing asynchronous
+ // closing of this one.
+ if (tab_strip_model_->GetActiveWebContents() &&
+ &tab_strip_model_->GetActiveWebContents()->GetController() ==
+ content::Source<NavigationController>(source).ptr())
+ UpdateToolbar(false);
+ break;
+
case chrome::NOTIFICATION_EXTENSION_UNLOADED: {
if (window()->GetLocationBar())
window()->GetLocationBar()->UpdatePageActions();
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | content/browser/ssl/ssl_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698