Chromium Code Reviews| 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 UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 5 #ifndef UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
| 6 #define UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 6 #define UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/observer_list.h" | |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "ui/app_list/app_list_export.h" | 15 #include "ui/app_list/app_list_export.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class FilePath; | 18 class FilePath; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 class WebContents; | 22 class WebContents; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace gfx { | 25 namespace gfx { |
| 25 class ImageSkia; | 26 class ImageSkia; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace app_list { | 29 namespace app_list { |
| 29 | 30 |
| 30 class AppListItemModel; | 31 class AppListItemModel; |
| 31 class AppListModel; | 32 class AppListModel; |
| 33 class AppListViewDelegateObserver; | |
| 32 class SearchResult; | 34 class SearchResult; |
| 33 class SigninDelegate; | 35 class SigninDelegate; |
| 34 | 36 |
| 35 class APP_LIST_EXPORT AppListViewDelegate { | 37 class APP_LIST_EXPORT AppListViewDelegate { |
| 36 public: | 38 public: |
| 37 // A user of the app list. | 39 // A user of the app list. |
| 38 struct APP_LIST_EXPORT User { | 40 struct APP_LIST_EXPORT User { |
| 39 User(); | 41 User(); |
| 40 ~User(); | 42 ~User(); |
| 41 | 43 |
| 42 // Whether or not this user is the current user of the app list. | 44 // Whether or not this user is the current user of the app list. |
| 43 bool active; | 45 bool active; |
| 44 | 46 |
| 45 // The name of this user. | 47 // The name of this user. |
| 46 base::string16 name; | 48 base::string16 name; |
| 47 | 49 |
| 48 // The email address of this user. | 50 // The email address of this user. |
| 49 base::string16 email; | 51 base::string16 email; |
| 50 | 52 |
| 51 // The path to this user's profile directory. | 53 // The path to this user's profile directory. |
| 52 base::FilePath profile_path; | 54 base::FilePath profile_path; |
| 53 }; | 55 }; |
| 54 typedef std::vector<User> Users; | 56 typedef std::vector<User> Users; |
| 55 | 57 |
| 58 AppListViewDelegate() {} | |
|
tapted
2013/11/22 00:03:19
heads-up clang will probably complain about this a
| |
| 59 | |
| 56 // AppListView owns the delegate. | 60 // AppListView owns the delegate. |
| 57 virtual ~AppListViewDelegate() {} | 61 virtual ~AppListViewDelegate() {} |
| 58 | 62 |
| 59 // Whether to force the use of a native desktop widget when the app list | 63 // Whether to force the use of a native desktop widget when the app list |
| 60 // window is first created. | 64 // window is first created. |
| 61 virtual bool ForceNativeDesktop() const = 0; | 65 virtual bool ForceNativeDesktop() const = 0; |
| 62 | 66 |
| 63 // Sets the delegate to use the profile at |profile_path|. This is currently | 67 // Sets the delegate to use the profile at |profile_path|. This is currently |
| 64 // only used by non-Ash Windows. | 68 // only used by non-Ash Windows. |
| 65 virtual void SetProfileByPath(const base::FilePath& profile_path) = 0; | 69 virtual void SetProfileByPath(const base::FilePath& profile_path) = 0; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 // Invoked to toggle the status of speech recognition. | 120 // Invoked to toggle the status of speech recognition. |
| 117 virtual void ToggleSpeechRecognition() = 0; | 121 virtual void ToggleSpeechRecognition() = 0; |
| 118 | 122 |
| 119 // Shows the app list for the profile specified by |profile_path|. | 123 // Shows the app list for the profile specified by |profile_path|. |
| 120 virtual void ShowForProfileByPath(const base::FilePath& profile_path) = 0; | 124 virtual void ShowForProfileByPath(const base::FilePath& profile_path) = 0; |
| 121 | 125 |
| 122 // Get the start page web contents. Owned by the AppListViewDelegate. | 126 // Get the start page web contents. Owned by the AppListViewDelegate. |
| 123 virtual content::WebContents* GetStartPageContents() = 0; | 127 virtual content::WebContents* GetStartPageContents() = 0; |
| 124 | 128 |
| 125 // Returns the list of users (for AppListMenu). | 129 // Returns the list of users (for AppListMenu). |
| 126 virtual const Users& GetUsers() const = 0; | 130 const Users& GetUsers() const; |
| 131 | |
| 132 void AddObserver(AppListViewDelegateObserver* observer); | |
| 133 void RemoveObserver(AppListViewDelegateObserver* observer); | |
| 134 | |
| 135 protected: | |
| 136 void NotifyUsersChanged(); | |
| 137 | |
| 138 Users users_; | |
| 139 ObserverList<AppListViewDelegateObserver> observers_; | |
| 140 | |
| 141 private: | |
| 142 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); | |
| 127 }; | 143 }; |
| 128 | 144 |
| 129 } // namespace app_list | 145 } // namespace app_list |
| 130 | 146 |
| 131 #endif // UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 147 #endif // UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
| OLD | NEW |