| 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> |
| 11 | 11 |
| 12 #include "ash/common/shelf/shelf_item_delegate.h" | 12 #include "ash/common/shelf/shelf_item_delegate.h" |
| 13 #include "ash/common/shelf/shelf_item_types.h" | 13 #include "ash/common/shelf/shelf_item_types.h" |
| 14 #include "ash/public/cpp/shelf_application_menu_item.h" | 14 #include "ash/public/cpp/shelf_application_menu_item.h" |
| 15 #include "ash/public/interfaces/shelf.mojom.h" | 15 #include "ash/public/interfaces/shelf.mojom.h" |
| 16 #include "chrome/browser/ui/app_icon_loader.h" | 16 #include "chrome/browser/ui/app_icon_loader.h" |
| 17 #include "chrome/browser/ui/app_icon_loader_delegate.h" | 17 #include "chrome/browser/ui/app_icon_loader_delegate.h" |
| 18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 19 #include "chrome/browser/ui/ash/app_launcher_id.h" |
| 19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" | 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" |
| 20 #include "chrome/browser/ui/ash/launcher/settings_window_observer.h" | 21 #include "chrome/browser/ui/ash/launcher/settings_window_observer.h" |
| 21 #include "mojo/public/cpp/bindings/associated_binding.h" | 22 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 22 | 23 |
| 23 class AccountId; | 24 class AccountId; |
| 24 class ArcAppDeferredLauncherController; | 25 class ArcAppDeferredLauncherController; |
| 25 class BrowserShortcutLauncherItemController; | 26 class BrowserShortcutLauncherItemController; |
| 26 class GURL; | 27 class GURL; |
| 27 class LauncherControllerHelper; | 28 class LauncherControllerHelper; |
| 28 class LauncherItemController; | 29 class LauncherItemController; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 128 |
| 128 // Closes the specified item. | 129 // Closes the specified item. |
| 129 virtual void Close(ash::ShelfID id) = 0; | 130 virtual void Close(ash::ShelfID id) = 0; |
| 130 | 131 |
| 131 // Returns true if the specified item is open. | 132 // Returns true if the specified item is open. |
| 132 virtual bool IsOpen(ash::ShelfID id) = 0; | 133 virtual bool IsOpen(ash::ShelfID id) = 0; |
| 133 | 134 |
| 134 // Returns true if the specified item is for a platform app. | 135 // Returns true if the specified item is for a platform app. |
| 135 virtual bool IsPlatformApp(ash::ShelfID id) = 0; | 136 virtual bool IsPlatformApp(ash::ShelfID id) = 0; |
| 136 | 137 |
| 137 // Opens a new instance of the application identified by |app_id|. | 138 // Opens a new instance of the application identified by the AppLauncherId. |
| 138 // Used by the app-list, and by pinned-app shelf items. | 139 // Used by the app-list, and by pinned-app shelf items. |
| 139 void LaunchApp(const std::string& app_id, | 140 void LaunchApp(ash::launcher::AppLauncherId id, |
| 140 ash::LaunchSource source, | 141 ash::LaunchSource source, |
| 141 int event_flags); | 142 int event_flags); |
| 142 | 143 |
| 143 // As above but includes |launch_id|, an id that can be passed to an app when | |
| 144 // launched in order to support multiple shelf items per app. | |
| 145 void LaunchAppWithLaunchId(const std::string& app_id, | |
| 146 const std::string& launch_id, | |
| 147 ash::LaunchSource source, | |
| 148 int event_flags); | |
| 149 | |
| 150 // If |app_id| is running, reactivates the app's most recently active window, | 144 // If |app_id| is running, reactivates the app's most recently active window, |
| 151 // otherwise launches and activates the app. | 145 // otherwise launches and activates the app. |
| 152 // Used by the app-list, and by pinned-app shelf items. | 146 // Used by the app-list, and by pinned-app shelf items. |
| 153 virtual void ActivateApp(const std::string& app_id, | 147 virtual void ActivateApp(const std::string& app_id, |
| 154 ash::LaunchSource source, | 148 ash::LaunchSource source, |
| 155 int event_flags) = 0; | 149 int event_flags) = 0; |
| 156 | 150 |
| 157 // Set the image for a specific shelf item (e.g. when set by the app). | 151 // Set the image for a specific shelf item (e.g. when set by the app). |
| 158 virtual void SetLauncherItemImage(ash::ShelfID shelf_id, | 152 virtual void SetLauncherItemImage(ash::ShelfID shelf_id, |
| 159 const gfx::ImageSkia& image) = 0; | 153 const gfx::ImageSkia& image) = 0; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // An observer that manages the shelf title and icon for settings windows. | 309 // An observer that manages the shelf title and icon for settings windows. |
| 316 SettingsWindowObserver settings_window_observer_; | 310 SettingsWindowObserver settings_window_observer_; |
| 317 | 311 |
| 318 // Used to load the images for app items. | 312 // Used to load the images for app items. |
| 319 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; | 313 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; |
| 320 | 314 |
| 321 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 315 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
| 322 }; | 316 }; |
| 323 | 317 |
| 324 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 318 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |