Index: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
index 1815dea8947f52d17ae09f7f3716cbbba7450272..3c6109263110eb62b41330e47ba4361ccb906212 100644 |
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
@@ -10,7 +10,6 @@ |
#include "base/compiler_specific.h" |
#include "base/prefs/pref_service.h" |
#include "base/strings/utf_string_conversions.h" |
-#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/profiles/profiles_state.h" |
#include "chrome/browser/signin/signin_header_helper.h" |
#include "chrome/browser/themes/theme_properties.h" |
@@ -152,11 +151,6 @@ OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame, |
else |
UpdateAvatarInfo(); |
- if (!browser_view->IsOffTheRecord()) { |
- registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
- content::NotificationService::AllSources()); |
- } |
- |
platform_observer_.reset(OpaqueBrowserFrameViewPlatformSpecific::Create( |
this, layout_, browser_view->browser()->profile())); |
} |
@@ -369,23 +363,36 @@ gfx::ImageSkia OpaqueBrowserFrameView::GetFaviconForTabIconView() { |
/////////////////////////////////////////////////////////////////////////////// |
// OpaqueBrowserFrameView, protected: |
-void OpaqueBrowserFrameView::Observe( |
- int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) { |
- switch (type) { |
- case chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED: |
- if (browser_view() ->IsRegularOrGuestSession() && |
- switches::IsNewAvatarMenu()) { |
- UpdateNewStyleAvatarInfo(this, NewAvatarButton::THEMED_BUTTON); |
- } else { |
- UpdateAvatarInfo(); |
- } |
- break; |
- default: |
- NOTREACHED() << "Got a notification we didn't register for!"; |
- break; |
- } |
+void OpaqueBrowserFrameView::OnProfileAdded( |
+ const base::FilePath& profile_path) { |
+ if (browser_view()->IsRegularOrGuestSession() && switches::IsNewAvatarMenu()) |
+ UpdateNewStyleAvatarInfo(this, NewAvatarButton::NATIVE_BUTTON); |
+ else |
+ UpdateAvatarInfo(); |
+} |
+ |
+void OpaqueBrowserFrameView::OnProfileWasRemoved( |
+ const base::FilePath& profile_path, |
+ const base::string16& profile_name) { |
+ if (browser_view()->IsRegularOrGuestSession() && switches::IsNewAvatarMenu()) |
+ UpdateNewStyleAvatarInfo(this, NewAvatarButton::NATIVE_BUTTON); |
+ else |
+ UpdateAvatarInfo(); |
+} |
+ |
+void OpaqueBrowserFrameView::OnProfileNameChanged( |
+ const base::FilePath& profile_path, |
+ const base::string16& old_profile_name) { |
+ // Profile names are only displayed in the new UI. |
+ if (browser_view()->IsRegularOrGuestSession() && switches::IsNewAvatarMenu()) |
+ UpdateNewStyleAvatarInfo(this, NewAvatarButton::NATIVE_BUTTON); |
+} |
+ |
+void OpaqueBrowserFrameView::OnProfileAvatarChanged( |
+ const base::FilePath& profile_path) { |
+ // Profile avatars are only displayed in the old UI or incognito. |
+ if (browser_view()->IsOffTheRecord() || !switches::IsNewAvatarMenu()) |
+ UpdateAvatarInfo(); |
} |
/////////////////////////////////////////////////////////////////////////////// |