OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 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_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/scoped_observer.h" |
| 13 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "ui/aura/env_observer.h" |
| 16 #include "ui/aura/window_observer.h" |
| 17 |
| 18 namespace aura { |
| 19 class Window; |
| 20 } |
| 21 |
| 22 class ArcAppWindowLauncherItemController; |
| 23 class ChromeLauncherController; |
| 24 |
| 25 class ArcAppWindowLauncherController : public AppWindowLauncherController, |
| 26 public aura::EnvObserver, |
| 27 public aura::WindowObserver { |
| 28 public: |
| 29 explicit ArcAppWindowLauncherController(ChromeLauncherController* owner); |
| 30 ~ArcAppWindowLauncherController() override; |
| 31 |
| 32 // aura::EnvObserver: |
| 33 void OnWindowInitialized(aura::Window* window) override; |
| 34 |
| 35 // aura::WindowObserver: |
| 36 void OnWindowDestroying(aura::Window* window) override; |
| 37 void OnWindowPropertyChanged(aura::Window* window, |
| 38 const void* key, |
| 39 intptr_t old) override; |
| 40 |
| 41 private: |
| 42 class AppWindow; |
| 43 |
| 44 using WindowToAppWindow = std::map<aura::Window*, scoped_ptr<AppWindow>>; |
| 45 using AppControllerMap = |
| 46 std::map<std::string, ArcAppWindowLauncherItemController*>; |
| 47 |
| 48 AppWindow* GetAppWindowForTask(int task_id); |
| 49 |
| 50 void OnGetTaskInfo(int task_id, |
| 51 mojo::String package_name, |
| 52 mojo::String activity_name); |
| 53 |
| 54 // AppWindowLauncherController: |
| 55 AppWindowLauncherItemController* ControllerForWindow( |
| 56 aura::Window* window) override; |
| 57 |
| 58 WindowToAppWindow window_to_app_window_; |
| 59 AppControllerMap app_controller_map_; |
| 60 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; |
| 61 base::WeakPtrFactory<ArcAppWindowLauncherController> weak_ptr_factory_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); |
| 64 }; |
| 65 |
| 66 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |