OLD | NEW |
---|---|
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 #include <vector> | |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "content/public/browser/notification_observer.h" | |
16 #include "content/public/browser/notification_registrar.h" | |
14 #include "ui/app_list/app_list_view_delegate.h" | 17 #include "ui/app_list/app_list_view_delegate.h" |
18 #include "ui/app_list/signin_delegate_observer.h" | |
15 | 19 |
16 class AppListControllerDelegate; | 20 class AppListControllerDelegate; |
17 class AppsModelBuilder; | 21 class AppsModelBuilder; |
18 class Profile; | 22 class Profile; |
19 | 23 |
20 namespace app_list { | 24 namespace app_list { |
21 class SearchController; | 25 class SearchController; |
22 } | 26 } |
23 | 27 |
24 namespace base { | 28 namespace base { |
25 class FilePath; | 29 class FilePath; |
26 } | 30 } |
27 | 31 |
28 namespace gfx { | 32 namespace gfx { |
29 class ImageSkia; | 33 class ImageSkia; |
30 } | 34 } |
31 | 35 |
32 #if defined(USE_ASH) | 36 #if defined(USE_ASH) |
33 class AppSyncUIStateWatcher; | 37 class AppSyncUIStateWatcher; |
34 #endif | 38 #endif |
35 | 39 |
36 class AppListViewDelegate : public app_list::AppListViewDelegate { | 40 class AppListViewDelegate : public app_list::AppListViewDelegate, |
41 public app_list::SigninDelegateObserver, | |
42 public content::NotificationObserver { | |
tapted
2013/08/05 03:01:39
too many spaces before {
calamity
2013/08/08 04:52:12
Done.
| |
37 public: | 43 public: |
38 // The delegate will take ownership of the controller. | 44 // The delegate will take ownership of the controller. |
39 AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile); | 45 AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile); |
40 virtual ~AppListViewDelegate(); | 46 virtual ~AppListViewDelegate(); |
47 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE; | |
tapted
2013/08/05 03:01:39
nit: should say where it's overridden from
calamity
2013/08/08 04:52:12
Done.
| |
41 | 48 |
42 private: | 49 private: |
50 // Registers the current profile for notifications. | |
51 void RegisterForNotifications(); | |
52 | |
43 // Overridden from app_list::AppListViewDelegate: | 53 // Overridden from app_list::AppListViewDelegate: |
44 virtual void SetModel(app_list::AppListModel* model) OVERRIDE; | 54 virtual void InitModel(app_list::AppListModel* model) OVERRIDE; |
45 virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE; | 55 virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE; |
46 virtual void GetShortcutPathForApp( | 56 virtual void GetShortcutPathForApp( |
47 const std::string& app_id, | 57 const std::string& app_id, |
48 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 58 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
49 virtual void ActivateAppListItem(app_list::AppListItemModel* item, | 59 virtual void ActivateAppListItem(app_list::AppListItemModel* item, |
50 int event_flags) OVERRIDE; | 60 int event_flags) OVERRIDE; |
51 virtual void StartSearch() OVERRIDE; | 61 virtual void StartSearch() OVERRIDE; |
52 virtual void StopSearch() OVERRIDE; | 62 virtual void StopSearch() OVERRIDE; |
53 virtual void OpenSearchResult(app_list::SearchResult* result, | 63 virtual void OpenSearchResult(app_list::SearchResult* result, |
54 int event_flags) OVERRIDE; | 64 int event_flags) OVERRIDE; |
55 virtual void InvokeSearchResultAction(app_list::SearchResult* result, | 65 virtual void InvokeSearchResultAction(app_list::SearchResult* result, |
56 int action_index, | 66 int action_index, |
57 int event_flags) OVERRIDE; | 67 int event_flags) OVERRIDE; |
58 virtual void Dismiss() OVERRIDE; | 68 virtual void Dismiss() OVERRIDE; |
59 virtual void ViewClosing() OVERRIDE; | 69 virtual void ViewClosing() OVERRIDE; |
60 virtual void ViewActivationChanged(bool active) OVERRIDE; | 70 virtual void ViewActivationChanged(bool active) OVERRIDE; |
61 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; | 71 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
62 virtual string16 GetCurrentUserName() OVERRIDE; | |
63 virtual string16 GetCurrentUserEmail() OVERRIDE; | |
64 virtual void OpenSettings() OVERRIDE; | 72 virtual void OpenSettings() OVERRIDE; |
65 virtual void OpenHelp() OVERRIDE; | 73 virtual void OpenHelp() OVERRIDE; |
66 virtual void OpenFeedback() OVERRIDE; | 74 virtual void OpenFeedback() OVERRIDE; |
75 virtual void ShowForProfileByPath( | |
76 const base::FilePath& profile_path) OVERRIDE; | |
77 virtual void UpdateModelWithCurrentProfiles() OVERRIDE; | |
78 | |
79 // Overriden from app_list::SigninDelegateObserver: | |
tapted
2013/08/05 03:01:39
Overriden -> overridden (spelling)
calamity
2013/08/08 04:52:12
Done.
| |
80 virtual void OnSigninSuccess() OVERRIDE; | |
81 | |
82 // content::NotificationObserver | |
tapted
2013/08/05 03:01:39
nit: Overridden from.., to be consistent
calamity
2013/08/08 04:52:12
Done.
| |
83 virtual void Observe(int type, | |
84 const content::NotificationSource& source, | |
85 const content::NotificationDetails& details) OVERRIDE; | |
67 | 86 |
68 scoped_ptr<app_list::SigninDelegate> signin_delegate_; | 87 scoped_ptr<app_list::SigninDelegate> signin_delegate_; |
69 scoped_ptr<AppsModelBuilder> apps_builder_; | 88 scoped_ptr<AppsModelBuilder> apps_builder_; |
70 scoped_ptr<app_list::SearchController> search_controller_; | 89 scoped_ptr<app_list::SearchController> search_controller_; |
71 scoped_ptr<AppListControllerDelegate> controller_; | 90 scoped_ptr<AppListControllerDelegate> controller_; |
72 Profile* profile_; | 91 Profile* profile_; |
92 app_list::AppListModel* model_; // Weak. Owned by AppListView. | |
93 | |
94 content::NotificationRegistrar registrar_; | |
73 | 95 |
74 #if defined(USE_ASH) | 96 #if defined(USE_ASH) |
75 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; | 97 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; |
76 #endif | 98 #endif |
77 | 99 |
78 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); | 100 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); |
79 }; | 101 }; |
80 | 102 |
81 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 103 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
OLD | NEW |