| 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 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
| 13 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" | 13 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "ui/aura/env_observer.h" | 15 #include "ui/aura/env_observer.h" |
| 16 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
| 17 | 17 |
| 18 namespace aura { | 18 namespace aura { |
| 19 class Window; | 19 class Window; |
| 20 } | 20 } |
| 21 | 21 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // aura::WindowObserver: | 35 // aura::WindowObserver: |
| 36 void OnWindowDestroying(aura::Window* window) override; | 36 void OnWindowDestroying(aura::Window* window) override; |
| 37 void OnWindowPropertyChanged(aura::Window* window, | 37 void OnWindowPropertyChanged(aura::Window* window, |
| 38 const void* key, | 38 const void* key, |
| 39 intptr_t old) override; | 39 intptr_t old) override; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 class AppWindow; | 42 class AppWindow; |
| 43 | 43 |
| 44 using WindowToAppWindow = std::map<aura::Window*, scoped_ptr<AppWindow>>; | 44 using WindowToAppWindow = std::map<aura::Window*, std::unique_ptr<AppWindow>>; |
| 45 using AppControllerMap = | 45 using AppControllerMap = |
| 46 std::map<std::string, ArcAppWindowLauncherItemController*>; | 46 std::map<std::string, ArcAppWindowLauncherItemController*>; |
| 47 | 47 |
| 48 AppWindow* GetAppWindowForTask(int task_id); | 48 AppWindow* GetAppWindowForTask(int task_id); |
| 49 | 49 |
| 50 void OnGetTaskInfo(int task_id, | 50 void OnGetTaskInfo(int task_id, |
| 51 mojo::String package_name, | 51 mojo::String package_name, |
| 52 mojo::String activity_name); | 52 mojo::String activity_name); |
| 53 | 53 |
| 54 // AppWindowLauncherController: | 54 // AppWindowLauncherController: |
| 55 AppWindowLauncherItemController* ControllerForWindow( | 55 AppWindowLauncherItemController* ControllerForWindow( |
| 56 aura::Window* window) override; | 56 aura::Window* window) override; |
| 57 | 57 |
| 58 WindowToAppWindow window_to_app_window_; | 58 WindowToAppWindow window_to_app_window_; |
| 59 AppControllerMap app_controller_map_; | 59 AppControllerMap app_controller_map_; |
| 60 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; | 60 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; |
| 61 base::WeakPtrFactory<ArcAppWindowLauncherController> weak_ptr_factory_; | 61 base::WeakPtrFactory<ArcAppWindowLauncherController> weak_ptr_factory_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); | 63 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 66 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |