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

Side by Side Diff: chrome/browser/ui/app_list/app_list_view_delegate.h

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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/profiles/profile_info_cache_observer.h"
14 #include "content/public/browser/notification_observer.h" 15 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/notification_registrar.h" 16 #include "content/public/browser/notification_registrar.h"
16 #include "ui/app_list/app_list_view_delegate.h" 17 #include "ui/app_list/app_list_view_delegate.h"
17 #include "ui/app_list/signin_delegate_observer.h" 18 #include "ui/app_list/signin_delegate_observer.h"
18 19
19 class AppListControllerDelegate; 20 class AppListControllerDelegate;
20 class AppsModelBuilder; 21 class AppsModelBuilder;
21 class Profile; 22 class Profile;
22 23
23 namespace app_list { 24 namespace app_list {
(...skipping 12 matching lines...) Expand all
36 namespace gfx { 37 namespace gfx {
37 class ImageSkia; 38 class ImageSkia;
38 } 39 }
39 40
40 #if defined(USE_ASH) 41 #if defined(USE_ASH)
41 class AppSyncUIStateWatcher; 42 class AppSyncUIStateWatcher;
42 #endif 43 #endif
43 44
44 class AppListViewDelegate : public app_list::AppListViewDelegate, 45 class AppListViewDelegate : public app_list::AppListViewDelegate,
45 public app_list::SigninDelegateObserver, 46 public app_list::SigninDelegateObserver,
46 public content::NotificationObserver { 47 public content::NotificationObserver,
48 public ProfileInfoCacheObserver {
47 public: 49 public:
48 // The delegate will take ownership of the controller. 50 // The delegate will take ownership of the controller.
49 AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile); 51 AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile);
50 virtual ~AppListViewDelegate(); 52 virtual ~AppListViewDelegate();
51 53
52 private: 54 private:
53 void OnProfileChanged(); 55 void OnProfileChanged();
54 56
55 // Overridden from app_list::AppListViewDelegate: 57 // Overridden from app_list::AppListViewDelegate:
56 virtual void SetModel(app_list::AppListModel* model) OVERRIDE; 58 virtual void SetModel(app_list::AppListModel* model) OVERRIDE;
(...skipping 19 matching lines...) Expand all
76 virtual void OpenFeedback() OVERRIDE; 78 virtual void OpenFeedback() OVERRIDE;
77 79
78 // Overridden from app_list::SigninDelegateObserver: 80 // Overridden from app_list::SigninDelegateObserver:
79 virtual void OnSigninSuccess() OVERRIDE; 81 virtual void OnSigninSuccess() OVERRIDE;
80 82
81 // Overridden from content::NotificationObserver: 83 // Overridden from content::NotificationObserver:
82 virtual void Observe(int type, 84 virtual void Observe(int type,
83 const content::NotificationSource& source, 85 const content::NotificationSource& source,
84 const content::NotificationDetails& details) OVERRIDE; 86 const content::NotificationDetails& details) OVERRIDE;
85 87
88 // Overridden from ProfileInfoCacheObserver:
89 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE;
90 virtual void OnProfileWillBeRemoved(
91 const base::FilePath& profile_path) OVERRIDE;
92 virtual void OnProfileNameChanged(const base::FilePath& profile_path,
93 const string16& old_profile_name) OVERRIDE;
tapted 2013/08/15 06:34:31 nit: base::string16 + #include base/strings/string
calamity 2013/08/15 09:16:46 Done.
tfarina 2013/08/15 17:01:51 if this is an override, it means profile_info_cach
94
86 scoped_ptr<app_list::SigninDelegate> signin_delegate_; 95 scoped_ptr<app_list::SigninDelegate> signin_delegate_;
87 scoped_ptr<AppsModelBuilder> apps_builder_; 96 scoped_ptr<AppsModelBuilder> apps_builder_;
88 scoped_ptr<app_list::SearchController> search_controller_; 97 scoped_ptr<app_list::SearchController> search_controller_;
89 scoped_ptr<AppListControllerDelegate> controller_; 98 scoped_ptr<AppListControllerDelegate> controller_;
90 Profile* profile_; 99 Profile* profile_;
91 app_list::AppListModel* model_; // Weak. Owned by AppListView. 100 app_list::AppListModel* model_; // Weak. Owned by AppListView.
92 101
93 content::NotificationRegistrar registrar_; 102 content::NotificationRegistrar registrar_;
94 103
95 #if defined(USE_ASH) 104 #if defined(USE_ASH)
96 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; 105 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_;
97 #endif 106 #endif
98 107
99 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); 108 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate);
100 }; 109 };
101 110
102 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ 111 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698