| 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 "base/time/time.h" |
| 15 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 14 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 16 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 15 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" | 17 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
| 16 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" | 18 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" |
| 17 #include "mojo/public/cpp/bindings/binding.h" | 19 #include "mojo/public/cpp/bindings/binding.h" |
| 18 #include "ui/aura/env_observer.h" | 20 #include "ui/aura/env_observer.h" |
| 19 #include "ui/aura/window_observer.h" | 21 #include "ui/aura/window_observer.h" |
| 20 | 22 |
| 21 namespace aura { | 23 namespace aura { |
| 22 class Window; | 24 class Window; |
| 23 } | 25 } |
| 24 | 26 |
| 25 class ArcAppWindow; | 27 class ArcAppWindow; |
| 26 class ArcAppWindowLauncherItemController; | 28 class ArcAppWindowLauncherItemController; |
| 27 class ChromeLauncherController; | 29 class ChromeLauncherController; |
| 28 | 30 |
| 29 class Profile; | 31 class Profile; |
| 30 | 32 |
| 31 class ArcAppWindowLauncherController : public AppWindowLauncherController, | 33 class ArcAppWindowLauncherController : public AppWindowLauncherController, |
| 32 public aura::EnvObserver, | 34 public aura::EnvObserver, |
| 33 public aura::WindowObserver, | 35 public aura::WindowObserver, |
| 34 public ash::ShellObserver, | 36 public ash::ShellObserver, |
| 35 public ArcAppListPrefs::Observer { | 37 public ArcAppListPrefs::Observer, |
| 38 public arc::ArcSessionManager::Observer { |
| 36 public: | 39 public: |
| 37 explicit ArcAppWindowLauncherController(ChromeLauncherController* owner); | 40 explicit ArcAppWindowLauncherController(ChromeLauncherController* owner); |
| 38 ~ArcAppWindowLauncherController() override; | 41 ~ArcAppWindowLauncherController() override; |
| 39 | 42 |
| 40 // Returns ARC task id for the window. | 43 // Returns ARC task id for the window. |
| 41 static int GetWindowTaskId(aura::Window* window); | 44 static int GetWindowTaskId(aura::Window* window); |
| 42 | 45 |
| 43 // AppWindowLauncherController: | 46 // AppWindowLauncherController: |
| 44 void ActiveUserChanged(const std::string& user_email) override; | 47 void ActiveUserChanged(const std::string& user_email) override; |
| 45 void AdditionalUserAddedToSession(Profile* profile) override; | 48 void AdditionalUserAddedToSession(Profile* profile) override; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 const AppWindowInfo& app_window_info); | 109 const AppWindowInfo& app_window_info); |
| 107 | 110 |
| 108 void SetOrientationLockForAppWindow(ArcAppWindow* app_window); | 111 void SetOrientationLockForAppWindow(ArcAppWindow* app_window); |
| 109 | 112 |
| 110 std::vector<int> GetTaskIdsForApp(const std::string& arc_app_id) const; | 113 std::vector<int> GetTaskIdsForApp(const std::string& arc_app_id) const; |
| 111 | 114 |
| 112 // AppWindowLauncherController: | 115 // AppWindowLauncherController: |
| 113 AppWindowLauncherItemController* ControllerForWindow( | 116 AppWindowLauncherItemController* ControllerForWindow( |
| 114 aura::Window* window) override; | 117 aura::Window* window) override; |
| 115 | 118 |
| 119 // arc::ArcSessionManager::Observer: |
| 120 void OnArcOptInManagementCheckStarted() override; |
| 121 void OnArcSessionStopped(arc::ArcStopReason stop_reason) override; |
| 122 |
| 116 int active_task_id_ = -1; | 123 int active_task_id_ = -1; |
| 117 TaskIdToAppWindowInfo task_id_to_app_window_info_; | 124 TaskIdToAppWindowInfo task_id_to_app_window_info_; |
| 118 ShelfGroupToAppControllerMap app_shelf_group_to_controller_map_; | 125 ShelfGroupToAppControllerMap app_shelf_group_to_controller_map_; |
| 119 std::vector<aura::Window*> observed_windows_; | 126 std::vector<aura::Window*> observed_windows_; |
| 120 Profile* observed_profile_ = nullptr; | 127 Profile* observed_profile_ = nullptr; |
| 121 bool observing_shell_ = false; | 128 bool observing_shell_ = false; |
| 122 | 129 |
| 130 // The time when the ARC OptIn management check was started. This happens |
| 131 // right after user agrees the ToS or in some cases for managed user when ARC |
| 132 // starts for the first time. OptIn management check is preceding step before |
| 133 // ARC container is actually started. |
| 134 base::Time opt_in_management_check_start_time_; |
| 135 |
| 123 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); | 136 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); |
| 124 }; | 137 }; |
| 125 | 138 |
| 126 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 139 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |