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

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

Issue 22268009: Move signin status and current user information into AppListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implemented for mac 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.h
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.h b/chrome/browser/ui/app_list/app_list_view_delegate.h
index 0b5d121dfbe3c455b6759b53ff2b7932b91e774a..e06488d52170faa183572205569e1532fa306a52 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.h
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.h
@@ -11,7 +11,10 @@
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "ui/app_list/app_list_view_delegate.h"
+#include "ui/app_list/signin_delegate_observer.h"
class AppListControllerDelegate;
class AppsModelBuilder;
@@ -33,13 +36,19 @@ class ImageSkia;
class AppSyncUIStateWatcher;
#endif
-class AppListViewDelegate : public app_list::AppListViewDelegate {
+class AppListViewDelegate : public app_list::AppListViewDelegate,
+ public app_list::SigninDelegateObserver,
+ public content::NotificationObserver {
public:
// The delegate will take ownership of the controller.
AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile);
virtual ~AppListViewDelegate();
private:
+ // Registers the current profile for notifications.
+ void RegisterForNotifications();
tapted 2013/08/14 03:53:11 this function isn't defined any more
calamity 2013/08/14 09:19:00 Done.
+ void OnProfileChanged();
+
// Overridden from app_list::AppListViewDelegate:
virtual void SetModel(app_list::AppListModel* model) OVERRIDE;
virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE;
@@ -59,17 +68,26 @@ class AppListViewDelegate : public app_list::AppListViewDelegate {
virtual void ViewClosing() OVERRIDE;
virtual void ViewActivationChanged(bool active) OVERRIDE;
virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
- virtual string16 GetCurrentUserName() OVERRIDE;
- virtual string16 GetCurrentUserEmail() OVERRIDE;
virtual void OpenSettings() OVERRIDE;
virtual void OpenHelp() OVERRIDE;
virtual void OpenFeedback() OVERRIDE;
+ // Overridden from app_list::SigninDelegateObserver:
+ virtual void OnSigninSuccess() OVERRIDE;
+
+ // Overridden from content::NotificationObserver:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
scoped_ptr<app_list::SigninDelegate> signin_delegate_;
scoped_ptr<AppsModelBuilder> apps_builder_;
scoped_ptr<app_list::SearchController> search_controller_;
scoped_ptr<AppListControllerDelegate> controller_;
Profile* profile_;
+ app_list::AppListModel* model_; // Weak. Owned by AppListView.
+
+ content::NotificationRegistrar registrar_;
#if defined(USE_ASH)
scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_;

Powered by Google App Engine
This is Rietveld 408576698