| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ~ChromeLauncherController() override; | 78 ~ChromeLauncherController() override; |
| 79 | 79 |
| 80 // Initializes this ChromeLauncherController. | 80 // Initializes this ChromeLauncherController. |
| 81 virtual void Init() = 0; | 81 virtual void Init() = 0; |
| 82 | 82 |
| 83 // Creates a new app item on the shelf for |controller|. | 83 // Creates a new app item on the shelf for |controller|. |
| 84 virtual ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, | 84 virtual ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, |
| 85 const std::string& app_id, | 85 const std::string& app_id, |
| 86 ash::ShelfItemStatus status) = 0; | 86 ash::ShelfItemStatus status) = 0; |
| 87 | 87 |
| 88 // A helper to get the shelf item with the given id, which must be valid. |
| 89 virtual const ash::ShelfItem& GetItem(ash::ShelfID id) const = 0; |
| 90 |
| 91 // Updates the type of an item. |
| 92 virtual void SetItemType(ash::ShelfID id, ash::ShelfItemType type) = 0; |
| 93 |
| 88 // Updates the running status of an item. It will also update the status of | 94 // Updates the running status of an item. It will also update the status of |
| 89 // browsers shelf item if needed. | 95 // browsers shelf item if needed. |
| 90 virtual void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) = 0; | 96 virtual void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) = 0; |
| 91 | 97 |
| 92 // Updates the controller associated with id (which should be a shortcut). | 98 // Updates the controller associated with id (which should be a shortcut). |
| 93 // Takes ownership of |controller|. | 99 // Takes ownership of |controller|. |
| 94 // TODO(skuhne): Pass in scoped_ptr to make ownership clear. | 100 // TODO(skuhne): Pass in scoped_ptr to make ownership clear. |
| 95 virtual void SetItemController(ash::ShelfID id, | 101 virtual void SetItemController(ash::ShelfID id, |
| 96 LauncherItemController* controller) = 0; | 102 LauncherItemController* controller) = 0; |
| 97 | 103 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // |event_flags| specifies the flags which were set by the event which | 199 // |event_flags| specifies the flags which were set by the event which |
| 194 // triggered this menu generation. It can be used to generate different lists. | 200 // triggered this menu generation. It can be used to generate different lists. |
| 195 virtual ChromeLauncherAppMenuItems GetApplicationList( | 201 virtual ChromeLauncherAppMenuItems GetApplicationList( |
| 196 const ash::ShelfItem& item, | 202 const ash::ShelfItem& item, |
| 197 int event_flags) = 0; | 203 int event_flags) = 0; |
| 198 | 204 |
| 199 // Get the list of all tabs which belong to a certain application type. | 205 // Get the list of all tabs which belong to a certain application type. |
| 200 virtual std::vector<content::WebContents*> GetV1ApplicationsFromAppId( | 206 virtual std::vector<content::WebContents*> GetV1ApplicationsFromAppId( |
| 201 const std::string& app_id) = 0; | 207 const std::string& app_id) = 0; |
| 202 | 208 |
| 203 // Activates a specified shell application. | 209 // Activates a specified shell application by app id and window index. |
| 204 virtual void ActivateShellApp(const std::string& app_id, int index) = 0; | 210 virtual void ActivateShellApp(const std::string& app_id, |
| 211 int window_index) = 0; |
| 205 | 212 |
| 206 // Checks if a given |web_contents| is known to be associated with an | 213 // Checks if a given |web_contents| is known to be associated with an |
| 207 // application of type |app_id|. | 214 // application of type |app_id|. |
| 208 virtual bool IsWebContentHandledByApplication( | 215 virtual bool IsWebContentHandledByApplication( |
| 209 content::WebContents* web_contents, | 216 content::WebContents* web_contents, |
| 210 const std::string& app_id) = 0; | 217 const std::string& app_id) = 0; |
| 211 | 218 |
| 212 // Check if the gMail app is loaded and it can handle the given web content. | 219 // Check if the gMail app is loaded and it can handle the given web content. |
| 213 // This special treatment is required to address crbug.com/234268. | 220 // This special treatment is required to address crbug.com/234268. |
| 214 virtual bool ContentCanBeHandledByGmailApp( | 221 virtual bool ContentCanBeHandledByGmailApp( |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // An observer that manages the shelf title and icon for settings windows. | 317 // An observer that manages the shelf title and icon for settings windows. |
| 311 SettingsWindowObserver settings_window_observer_; | 318 SettingsWindowObserver settings_window_observer_; |
| 312 | 319 |
| 313 // Used to load the images for app items. | 320 // Used to load the images for app items. |
| 314 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; | 321 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; |
| 315 | 322 |
| 316 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 323 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
| 317 }; | 324 }; |
| 318 | 325 |
| 319 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 326 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |