| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Closes or unpins the shelf item. | 113 // Closes or unpins the shelf item. |
| 114 void CloseLauncherItem(const ash::ShelfID& id); | 114 void CloseLauncherItem(const ash::ShelfID& id); |
| 115 | 115 |
| 116 // Returns true if the item identified by |id| is pinned. | 116 // Returns true if the item identified by |id| is pinned. |
| 117 bool IsPinned(const ash::ShelfID& id); | 117 bool IsPinned(const ash::ShelfID& id); |
| 118 | 118 |
| 119 // Set the shelf item status for the V1 application with the given |app_id|. | 119 // Set the shelf item status for the V1 application with the given |app_id|. |
| 120 // Adds or removes an item as needed to respect the running and pinned state. | 120 // Adds or removes an item as needed to respect the running and pinned state. |
| 121 void SetV1AppStatus(const std::string& app_id, ash::ShelfItemStatus status); | 121 void SetV1AppStatus(const std::string& app_id, ash::ShelfItemStatus status); |
| 122 | 122 |
| 123 // Requests that the shelf item controller specified by |id| open a new | |
| 124 // instance of the app. |event_flags| holds the flags of the event which | |
| 125 // triggered this command. | |
| 126 void Launch(const ash::ShelfID& id, int event_flags); | |
| 127 | |
| 128 // Closes the specified item. | 123 // Closes the specified item. |
| 129 void Close(const ash::ShelfID& id); | 124 void Close(const ash::ShelfID& id); |
| 130 | 125 |
| 131 // Returns true if the specified item is open. | 126 // Returns true if the specified item is open. |
| 132 bool IsOpen(const ash::ShelfID& id); | 127 bool IsOpen(const ash::ShelfID& id); |
| 133 | 128 |
| 134 // Returns true if the specified item is for a platform app. | 129 // Returns true if the specified item is for a platform app. |
| 135 bool IsPlatformApp(const ash::ShelfID& id); | 130 bool IsPlatformApp(const ash::ShelfID& id); |
| 136 | 131 |
| 137 // Opens a new instance of the application identified by the ShelfID. | 132 // Opens a new instance of the application identified by the ShelfID. |
| 138 // Used by the app-list, and by pinned-app shelf items. | 133 // Used by the app-list, and by pinned-app shelf items. |display_id| is id of |
| 134 // the display from which the app is launched. |
| 139 void LaunchApp(const ash::ShelfID& id, | 135 void LaunchApp(const ash::ShelfID& id, |
| 140 ash::ShelfLaunchSource source, | 136 ash::ShelfLaunchSource source, |
| 141 int event_flags); | 137 int event_flags, |
| 138 int64_t display_id); |
| 142 | 139 |
| 143 // If |app_id| is running, reactivates the app's most recently active window, | 140 // If |app_id| is running, reactivates the app's most recently active window, |
| 144 // otherwise launches and activates the app. | 141 // otherwise launches and activates the app. |
| 145 // Used by the app-list, and by pinned-app shelf items. | 142 // Used by the app-list, and by pinned-app shelf items. |
| 146 void ActivateApp(const std::string& app_id, | 143 void ActivateApp(const std::string& app_id, |
| 147 ash::ShelfLaunchSource source, | 144 ash::ShelfLaunchSource source, |
| 148 int event_flags); | 145 int event_flags); |
| 149 | 146 |
| 150 // Set the image for a specific shelf item (e.g. when set by the app). | 147 // Set the image for a specific shelf item (e.g. when set by the app). |
| 151 void SetLauncherItemImage(const ash::ShelfID& shelf_id, | 148 void SetLauncherItemImage(const ash::ShelfID& shelf_id, |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 using RunningAppListIds = std::vector<std::string>; | 438 using RunningAppListIds = std::vector<std::string>; |
| 442 using RunningAppListIdMap = std::map<std::string, RunningAppListIds>; | 439 using RunningAppListIdMap = std::map<std::string, RunningAppListIds>; |
| 443 RunningAppListIdMap last_used_running_application_order_; | 440 RunningAppListIdMap last_used_running_application_order_; |
| 444 | 441 |
| 445 base::WeakPtrFactory<ChromeLauncherController> weak_ptr_factory_; | 442 base::WeakPtrFactory<ChromeLauncherController> weak_ptr_factory_; |
| 446 | 443 |
| 447 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 444 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
| 448 }; | 445 }; |
| 449 | 446 |
| 450 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 447 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |