| 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_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/shell_observer.h" | 12 #include "ash/shell_observer.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 14 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 15 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" | 15 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
| 16 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" | 16 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" |
| 17 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
| 18 #include "ui/aura/env_observer.h" | 18 #include "ui/aura/env_observer.h" |
| 19 #include "ui/aura/window_observer.h" | 19 #include "ui/aura/window_observer.h" |
| 20 | 20 |
| 21 namespace ash { | |
| 22 class ShelfDelegate; | |
| 23 } | |
| 24 | |
| 25 namespace aura { | 21 namespace aura { |
| 26 class Window; | 22 class Window; |
| 27 } | 23 } |
| 28 | 24 |
| 29 class ArcAppWindowLauncherItemController; | 25 class ArcAppWindowLauncherItemController; |
| 30 class ChromeLauncherController; | 26 class ChromeLauncherController; |
| 31 | 27 |
| 32 class Profile; | 28 class Profile; |
| 33 | 29 |
| 34 class ArcAppWindowLauncherController : public AppWindowLauncherController, | 30 class ArcAppWindowLauncherController : public AppWindowLauncherController, |
| 35 public aura::EnvObserver, | 31 public aura::EnvObserver, |
| 36 public aura::WindowObserver, | 32 public aura::WindowObserver, |
| 37 public ash::ShellObserver, | 33 public ash::ShellObserver, |
| 38 public ArcAppListPrefs::Observer { | 34 public ArcAppListPrefs::Observer { |
| 39 public: | 35 public: |
| 40 ArcAppWindowLauncherController(ChromeLauncherController* owner, | 36 explicit ArcAppWindowLauncherController(ChromeLauncherController* owner); |
| 41 ash::ShelfDelegate* shelf_delegate); | |
| 42 ~ArcAppWindowLauncherController() override; | 37 ~ArcAppWindowLauncherController() override; |
| 43 | 38 |
| 44 // Returns shelf app id. Play Store app is mapped to ARC platform host app. | 39 // Returns shelf app id. Play Store app is mapped to ARC platform host app. |
| 45 static std::string GetShelfAppIdFromArcAppId(const std::string& arc_app_id); | 40 static std::string GetShelfAppIdFromArcAppId(const std::string& arc_app_id); |
| 46 | 41 |
| 47 // Returns ARC app id. ARC platform host app is mapped to Play Store app. | 42 // Returns ARC app id. ARC platform host app is mapped to Play Store app. |
| 48 static std::string GetArcAppIdFromShelfAppId(const std::string& shelf_app_id); | 43 static std::string GetArcAppIdFromShelfAppId(const std::string& shelf_app_id); |
| 49 | 44 |
| 50 // Returns ARC task id for the window. | 45 // Returns ARC task id for the window. |
| 51 static int GetWindowTaskId(aura::Window* window); | 46 static int GetWindowTaskId(aura::Window* window); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 const AppWindowInfo& app_window_info); | 106 const AppWindowInfo& app_window_info); |
| 112 | 107 |
| 113 void SetOrientationLockForAppWindow(AppWindow* app_window); | 108 void SetOrientationLockForAppWindow(AppWindow* app_window); |
| 114 | 109 |
| 115 std::vector<int> GetTaskIdsForApp(const std::string& arc_app_id) const; | 110 std::vector<int> GetTaskIdsForApp(const std::string& arc_app_id) const; |
| 116 | 111 |
| 117 // AppWindowLauncherController: | 112 // AppWindowLauncherController: |
| 118 AppWindowLauncherItemController* ControllerForWindow( | 113 AppWindowLauncherItemController* ControllerForWindow( |
| 119 aura::Window* window) override; | 114 aura::Window* window) override; |
| 120 | 115 |
| 121 // Not owned | |
| 122 ash::ShelfDelegate* shelf_delegate_; | |
| 123 int active_task_id_ = -1; | 116 int active_task_id_ = -1; |
| 124 TaskIdToAppWindowInfo task_id_to_app_window_info_; | 117 TaskIdToAppWindowInfo task_id_to_app_window_info_; |
| 125 ShelfGroupToAppControllerMap app_shelf_group_to_controller_map_; | 118 ShelfGroupToAppControllerMap app_shelf_group_to_controller_map_; |
| 126 std::vector<aura::Window*> observed_windows_; | 119 std::vector<aura::Window*> observed_windows_; |
| 127 Profile* observed_profile_ = nullptr; | 120 Profile* observed_profile_ = nullptr; |
| 128 bool observing_shell_ = false; | 121 bool observing_shell_ = false; |
| 129 | 122 |
| 130 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); | 123 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); |
| 131 }; | 124 }; |
| 132 | 125 |
| 133 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 126 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |