| 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> | |
| 9 #include <vector> | 8 #include <vector> |
| 10 | 9 |
| 11 #include "base/callback_forward.h" | |
| 12 #include "base/files/file_path.h" | |
| 13 #include "base/strings/string16.h" | |
| 14 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 15 #include "ui/app_list/app_list_export.h" | 11 #include "ui/app_list/app_list_export.h" |
| 16 | 12 |
| 17 namespace base { | |
| 18 class FilePath; | |
| 19 } | |
| 20 | |
| 21 namespace gfx { | 13 namespace gfx { |
| 22 class Size; | 14 class Size; |
| 23 } | 15 } |
| 24 | 16 |
| 25 #if defined(TOOLKIT_VIEWS) | |
| 26 namespace views { | 17 namespace views { |
| 27 class View; | 18 class View; |
| 28 } | 19 } |
| 29 #endif | |
| 30 | 20 |
| 31 namespace app_list { | 21 namespace app_list { |
| 32 | 22 |
| 33 class AppListModel; | 23 class AppListModel; |
| 34 class SearchResult; | 24 class SearchResult; |
| 35 class SpeechUIModel; | 25 class SpeechUIModel; |
| 36 | 26 |
| 37 class APP_LIST_EXPORT AppListViewDelegate { | 27 class APP_LIST_EXPORT AppListViewDelegate { |
| 38 public: | 28 public: |
| 39 // A user of the app list. | |
| 40 struct APP_LIST_EXPORT User { | |
| 41 User(); | |
| 42 User(const User& other); | |
| 43 ~User(); | |
| 44 | |
| 45 // Whether or not this user is the current user of the app list. | |
| 46 bool active; | |
| 47 | |
| 48 // The name of this user. | |
| 49 base::string16 name; | |
| 50 | |
| 51 // The email address of this user. | |
| 52 base::string16 email; | |
| 53 | |
| 54 // The path to this user's profile directory. | |
| 55 base::FilePath profile_path; | |
| 56 }; | |
| 57 typedef std::vector<User> Users; | |
| 58 | |
| 59 virtual ~AppListViewDelegate() {} | 29 virtual ~AppListViewDelegate() {} |
| 60 | |
| 61 // Whether to force the use of a native desktop widget when the app list | |
| 62 // window is first created. | |
| 63 virtual bool ForceNativeDesktop() const = 0; | |
| 64 | |
| 65 // Sets the delegate to use the profile at |profile_path|. This is currently | |
| 66 // only used by non-Ash Windows. | |
| 67 virtual void SetProfileByPath(const base::FilePath& profile_path) = 0; | |
| 68 | |
| 69 // Gets the model associated with the view delegate. The model may be owned | 30 // Gets the model associated with the view delegate. The model may be owned |
| 70 // by the delegate, or owned elsewhere (e.g. a profile keyed service). | 31 // by the delegate, or owned elsewhere (e.g. a profile keyed service). |
| 71 virtual AppListModel* GetModel() = 0; | 32 virtual AppListModel* GetModel() = 0; |
| 72 | 33 |
| 73 // Gets the SpeechUIModel for the app list. Owned by the AppListViewDelegate. | 34 // Gets the SpeechUIModel for the app list. Owned by the AppListViewDelegate. |
| 74 virtual SpeechUIModel* GetSpeechUI() = 0; | 35 virtual SpeechUIModel* GetSpeechUI() = 0; |
| 75 | 36 |
| 76 // Invoked to start a new search. Delegate collects query input from | 37 // Invoked to start a new search. Delegate collects query input from |
| 77 // SearchBoxModel and populates SearchResults. Both models are sub models | 38 // SearchBoxModel and populates SearchResults. Both models are sub models |
| 78 // of AppListModel. | 39 // of AppListModel. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 102 // Invoked when the app list UI is created. | 63 // Invoked when the app list UI is created. |
| 103 virtual void ViewInitialized() = 0; | 64 virtual void ViewInitialized() = 0; |
| 104 | 65 |
| 105 // Invoked to dismiss app list. This may leave the view open but hidden from | 66 // Invoked to dismiss app list. This may leave the view open but hidden from |
| 106 // the user. | 67 // the user. |
| 107 virtual void Dismiss() = 0; | 68 virtual void Dismiss() = 0; |
| 108 | 69 |
| 109 // Invoked when the app list is closing. | 70 // Invoked when the app list is closing. |
| 110 virtual void ViewClosing() = 0; | 71 virtual void ViewClosing() = 0; |
| 111 | 72 |
| 112 // Open the help UI. | |
| 113 virtual void OpenHelp() = 0; | |
| 114 | |
| 115 // Open the feedback UI. | |
| 116 virtual void OpenFeedback() = 0; | |
| 117 | |
| 118 // Invoked to toggle the status of speech recognition. | 73 // Invoked to toggle the status of speech recognition. |
| 119 virtual void StartSpeechRecognition() = 0; | 74 virtual void StartSpeechRecognition() = 0; |
| 120 virtual void StopSpeechRecognition() = 0; | 75 virtual void StopSpeechRecognition() = 0; |
| 121 | 76 |
| 122 // Shows the app list for the profile specified by |profile_path|. | |
| 123 virtual void ShowForProfileByPath(const base::FilePath& profile_path) = 0; | |
| 124 | |
| 125 #if defined(TOOLKIT_VIEWS) | |
| 126 // Creates the web view for the start page. The caller takes the ownership of | 77 // Creates the web view for the start page. The caller takes the ownership of |
| 127 // the returned view. | 78 // the returned view. |
| 128 virtual views::View* CreateStartPageWebView(const gfx::Size& size) = 0; | 79 virtual views::View* CreateStartPageWebView(const gfx::Size& size) = 0; |
| 129 | 80 |
| 130 // Creates the web views for the user-specified custom pages. The caller takes | 81 // Creates the web views for the user-specified custom pages. The caller takes |
| 131 // ownership of the returned views. | 82 // ownership of the returned views. |
| 132 virtual std::vector<views::View*> CreateCustomPageWebViews( | 83 virtual std::vector<views::View*> CreateCustomPageWebViews( |
| 133 const gfx::Size& size) = 0; | 84 const gfx::Size& size) = 0; |
| 134 | 85 |
| 135 // Invoked when the custom launcher page's animation changes. | 86 // Invoked when the custom launcher page's animation changes. |
| 136 virtual void CustomLauncherPageAnimationChanged(double progress) = 0; | 87 virtual void CustomLauncherPageAnimationChanged(double progress) = 0; |
| 137 | 88 |
| 138 // Invoked when the custom launcher page's subpage should be popped. | 89 // Invoked when the custom launcher page's subpage should be popped. |
| 139 virtual void CustomLauncherPagePopSubpage() = 0; | 90 virtual void CustomLauncherPagePopSubpage() = 0; |
| 140 #endif | |
| 141 | 91 |
| 142 // Returns true if the delegate supports speech recognition. | 92 // Returns true if the delegate supports speech recognition. |
| 143 virtual bool IsSpeechRecognitionEnabled() = 0; | 93 virtual bool IsSpeechRecognitionEnabled() = 0; |
| 144 | |
| 145 // Returns the list of users (for AppListMenu). | |
| 146 virtual const Users& GetUsers() const = 0; | |
| 147 }; | 94 }; |
| 148 | 95 |
| 149 } // namespace app_list | 96 } // namespace app_list |
| 150 | 97 |
| 151 #endif // UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 98 #endif // UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
| OLD | NEW |