| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ARC_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H
_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H
_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H
_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H
_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_set> | 9 #include <unordered_set> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" | 12 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" |
| 13 | 13 |
| 14 class ArcAppWindow; | 14 class ArcAppWindow; |
| 15 class ChromeLauncherController; | |
| 16 | 15 |
| 17 // Shelf item delegate for ARC app windows. | 16 // Shelf item delegate for ARC app windows. |
| 18 class ArcAppWindowLauncherItemController | 17 class ArcAppWindowLauncherItemController |
| 19 : public AppWindowLauncherItemController { | 18 : public AppWindowLauncherItemController { |
| 20 public: | 19 public: |
| 21 ArcAppWindowLauncherItemController(const std::string& arc_app_id, | 20 explicit ArcAppWindowLauncherItemController(const std::string& arc_app_id); |
| 22 ChromeLauncherController* owner); | |
| 23 | 21 |
| 24 ~ArcAppWindowLauncherItemController() override; | 22 ~ArcAppWindowLauncherItemController() override; |
| 25 | 23 |
| 26 // AppWindowLauncherItemController overrides: | 24 // AppWindowLauncherItemController overrides: |
| 27 void ItemSelected(std::unique_ptr<ui::Event> event, | 25 void ItemSelected(std::unique_ptr<ui::Event> event, |
| 28 int64_t display_id, | 26 int64_t display_id, |
| 29 ash::ShelfLaunchSource source, | 27 ash::ShelfLaunchSource source, |
| 30 ItemSelectedCallback callback) override; | 28 ItemSelectedCallback callback) override; |
| 31 ash::MenuItemList GetAppMenuItems(int event_flags) override; | 29 ash::MenuItemList GetAppMenuItems(int event_flags) override; |
| 32 void ExecuteCommand(uint32_t command_id, int32_t event_flags) override; | 30 void ExecuteCommand(uint32_t command_id, int32_t event_flags) override; |
| 33 | 31 |
| 34 void AddTaskId(int task_id); | 32 void AddTaskId(int task_id); |
| 35 void RemoveTaskId(int task_id); | 33 void RemoveTaskId(int task_id); |
| 36 bool HasAnyTasks() const; | 34 bool HasAnyTasks() const; |
| 37 | 35 |
| 38 // AppWindowLauncherItemController: | |
| 39 void UpdateLauncherItem() override; | |
| 40 | |
| 41 private: | 36 private: |
| 42 // Update the shelf item's icon for the active window. | 37 // Update the shelf item's icon for the active window. |
| 43 void UpdateIcon(ArcAppWindow* arc_app_window); | 38 void UpdateIcon(ArcAppWindow* arc_app_window); |
| 44 | 39 |
| 45 std::unordered_set<int> task_ids_; | 40 std::unordered_set<int> task_ids_; |
| 46 | 41 |
| 47 // Unowned property. | |
| 48 ChromeLauncherController* const owner_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherItemController); | 42 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherItemController); |
| 51 }; | 43 }; |
| 52 | 44 |
| 53 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_ITEM_CONTROLLE
R_H_ | 45 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_ITEM_CONTROLLE
R_H_ |
| OLD | NEW |