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

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

Issue 23179002: Update the app launcher menu on profile name change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@le_refactor_gigante_signin_into_model
Patch Set: actually register the observer Created 7 years, 4 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
Index: chrome/browser/ui/app_list/app_list_view_delegate.cc
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc
index dba22c70885eb3132f03e674ef5c488ce9a0f189..4145249f4e186dae261d6c5ded00ec985a581051 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -61,11 +61,14 @@ AppListViewDelegate::AppListViewDelegate(AppListControllerDelegate* controller,
DCHECK(profile_);
registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_SIGNED_OUT,
content::Source<Profile>(profile_));
+ g_browser_process->profile_manager()->GetProfileInfoCache().AddObserver(this);
}
AppListViewDelegate::~AppListViewDelegate() {
tapted 2013/08/15 06:34:31 Just be aware... I don't think this destructor is
if (signin_delegate_)
signin_delegate_->RemoveObserver(this);
+ g_browser_process->
+ profile_manager()->GetProfileInfoCache().RemoveObserver(this);
}
void AppListViewDelegate::OnProfileChanged() {
@@ -232,3 +235,18 @@ void AppListViewDelegate::Observe(
const content::NotificationDetails& details) {
OnProfileChanged();
}
+
+void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) {
+ OnProfileChanged();
tapted 2013/08/15 06:34:31 I don't think we need to do anything here
calamity 2013/08/15 09:16:46 Done.
+}
+
+void AppListViewDelegate::OnProfileWillBeRemoved(
+ const base::FilePath& profile_path) {
+ OnProfileChanged();
tapted 2013/08/15 06:34:31 This is currently handled in AppListServiceImpl::O
calamity 2013/08/15 09:16:46 Done.
+}
+
+void AppListViewDelegate::OnProfileNameChanged(
+ const base::FilePath& profile_path,
+ const string16& old_profile_name) {
tapted 2013/08/15 06:34:31 nit: base::string16
calamity 2013/08/15 09:16:46 Done.
+ OnProfileChanged();
tapted 2013/08/15 07:15:54 Probably also worth adding before this: if (profi
calamity 2013/08/15 09:16:46 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698