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

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

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compress pngs Created 7 years, 3 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 "chrome/browser/profiles/profile_info_cache_observer.h"
15 #include "chrome/browser/ui/app_list/chrome_signin_delegate.h"
15 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
17 #include "ui/app_list/app_list_view_delegate.h" 18 #include "ui/app_list/app_list_view_delegate.h"
18 19
19 class AppListControllerDelegate; 20 class AppListControllerDelegate;
20 class AppsModelBuilder; 21 class AppsModelBuilder;
22 class ChromeSigninDelegate;
tapted 2013/09/16 20:46:44 don't need this forward dec any more
calamity 2013/09/17 00:09:26 Done.
21 class Profile; 23 class Profile;
22 24
23 namespace app_list { 25 namespace app_list {
24 class SearchController; 26 class SearchController;
25 } 27 }
26 28
27 namespace base { 29 namespace base {
28 class FilePath; 30 class FilePath;
29 } 31 }
30 32
(...skipping 11 matching lines...) Expand all
42 #endif 44 #endif
43 45
44 class AppListViewDelegate : public app_list::AppListViewDelegate, 46 class AppListViewDelegate : public app_list::AppListViewDelegate,
45 public content::NotificationObserver, 47 public content::NotificationObserver,
46 public ProfileInfoCacheObserver { 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
54 // Overridden from app_list::AppListViewDelegate:
55 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE;
tapted 2013/09/16 20:46:44 can this go in the private section, with the other
calamity 2013/09/17 00:09:26 Done.
56
52 private: 57 private:
58 // Registers the current profile for notifications.
59 void RegisterForNotifications();
60 // Updates the app list's current profile and ProfileMenuItems.
53 void OnProfileChanged(); 61 void OnProfileChanged();
54 62
55 // Overridden from app_list::AppListViewDelegate: 63 // Overridden from app_list::AppListViewDelegate:
56 virtual void SetModel(app_list::AppListModel* model) OVERRIDE; 64 virtual void InitModel(app_list::AppListModel* model) OVERRIDE;
57 virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE; 65 virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE;
58 virtual void GetShortcutPathForApp( 66 virtual void GetShortcutPathForApp(
59 const std::string& app_id, 67 const std::string& app_id,
60 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; 68 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE;
61 virtual void ActivateAppListItem(app_list::AppListItemModel* item, 69 virtual void ActivateAppListItem(app_list::AppListItemModel* item,
62 int event_flags) OVERRIDE; 70 int event_flags) OVERRIDE;
63 virtual void StartSearch() OVERRIDE; 71 virtual void StartSearch() OVERRIDE;
64 virtual void StopSearch() OVERRIDE; 72 virtual void StopSearch() OVERRIDE;
65 virtual void OpenSearchResult(app_list::SearchResult* result, 73 virtual void OpenSearchResult(app_list::SearchResult* result,
66 int event_flags) OVERRIDE; 74 int event_flags) OVERRIDE;
67 virtual void InvokeSearchResultAction(app_list::SearchResult* result, 75 virtual void InvokeSearchResultAction(app_list::SearchResult* result,
68 int action_index, 76 int action_index,
69 int event_flags) OVERRIDE; 77 int event_flags) OVERRIDE;
70 virtual void Dismiss() OVERRIDE; 78 virtual void Dismiss() OVERRIDE;
71 virtual void ViewClosing() OVERRIDE; 79 virtual void ViewClosing() OVERRIDE;
72 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; 80 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
73 virtual void OpenSettings() OVERRIDE; 81 virtual void OpenSettings() OVERRIDE;
74 virtual void OpenHelp() OVERRIDE; 82 virtual void OpenHelp() OVERRIDE;
75 virtual void OpenFeedback() OVERRIDE; 83 virtual void OpenFeedback() OVERRIDE;
84 virtual void ShowForProfileByPath(
85 const base::FilePath& profile_path) OVERRIDE;
76 86
77 // Overridden from content::NotificationObserver: 87 // Overridden from content::NotificationObserver:
78 virtual void Observe(int type, 88 virtual void Observe(int type,
79 const content::NotificationSource& source, 89 const content::NotificationSource& source,
80 const content::NotificationDetails& details) OVERRIDE; 90 const content::NotificationDetails& details) OVERRIDE;
81 91
82 // Overridden from ProfileInfoCacheObserver: 92 // Overridden from ProfileInfoCacheObserver:
93 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE;
83 virtual void OnProfileNameChanged( 94 virtual void OnProfileNameChanged(
84 const base::FilePath& profile_path, 95 const base::FilePath& profile_path,
85 const base::string16& old_profile_name) OVERRIDE; 96 const base::string16& old_profile_name) OVERRIDE;
86 97
87 scoped_ptr<app_list::SigninDelegate> signin_delegate_;
88 scoped_ptr<AppsModelBuilder> apps_builder_; 98 scoped_ptr<AppsModelBuilder> apps_builder_;
89 scoped_ptr<app_list::SearchController> search_controller_; 99 scoped_ptr<app_list::SearchController> search_controller_;
90 scoped_ptr<AppListControllerDelegate> controller_; 100 scoped_ptr<AppListControllerDelegate> controller_;
91 Profile* profile_; 101 Profile* profile_;
92 app_list::AppListModel* model_; // Weak. Owned by AppListView. 102 app_list::AppListModel* model_; // Weak. Owned by AppListView.
93 103
94 content::NotificationRegistrar registrar_; 104 content::NotificationRegistrar registrar_;
105 ChromeSigninDelegate signin_delegate_;
95 #if defined(USE_ASH) 106 #if defined(USE_ASH)
96 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; 107 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_;
97 #endif 108 #endif
98 109
99 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); 110 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate);
100 }; 111 };
101 112
102 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ 113 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698