| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "athena/wm/public/window_manager.h" | 5 #include "athena/wm/public/window_manager.h" |
| 6 | 6 |
| 7 #include "athena/input/public/accelerator_manager.h" | 7 #include "athena/input/public/accelerator_manager.h" |
| 8 #include "athena/screen/public/screen_manager.h" | 8 #include "athena/screen/public/screen_manager.h" |
| 9 #include "athena/wm/public/window_manager_observer.h" | 9 #include "athena/wm/public/window_manager_observer.h" |
| 10 #include "athena/wm/window_overview_mode.h" | 10 #include "athena/wm/window_overview_mode.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "ui/aura/layout_manager.h" | 13 #include "ui/aura/layout_manager.h" |
| 14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 15 #include "ui/wm/core/window_util.h" |
| 15 #include "ui/wm/public/window_types.h" | 16 #include "ui/wm/public/window_types.h" |
| 16 | 17 |
| 17 namespace athena { | 18 namespace athena { |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 class WindowManagerImpl : public WindowManager, | 21 class WindowManagerImpl : public WindowManager, |
| 21 public WindowOverviewModeDelegate, | 22 public WindowOverviewModeDelegate, |
| 22 public aura::WindowObserver, | 23 public aura::WindowObserver, |
| 23 public AcceleratorHandler { | 24 public AcceleratorHandler { |
| 24 public: | 25 public: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 61 } |
| 61 | 62 |
| 62 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE { | 63 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE { |
| 63 observers_.RemoveObserver(observer); | 64 observers_.RemoveObserver(observer); |
| 64 } | 65 } |
| 65 | 66 |
| 66 // WindowOverviewModeDelegate: | 67 // WindowOverviewModeDelegate: |
| 67 virtual void OnSelectWindow(aura::Window* window) OVERRIDE { | 68 virtual void OnSelectWindow(aura::Window* window) OVERRIDE { |
| 68 CHECK_EQ(container_.get(), window->parent()); | 69 CHECK_EQ(container_.get(), window->parent()); |
| 69 container_->StackChildAtTop(window); | 70 container_->StackChildAtTop(window); |
| 71 wm::ActivateWindow(window); |
| 70 overview_.reset(); | 72 overview_.reset(); |
| 71 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, | 73 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, |
| 72 OnOverviewModeExit()); | 74 OnOverviewModeExit()); |
| 73 } | 75 } |
| 74 | 76 |
| 75 // aura::WindowObserver | 77 // aura::WindowObserver |
| 76 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE { | 78 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE { |
| 77 if (window == container_) | 79 if (window == container_) |
| 78 container_.reset(); | 80 container_.reset(); |
| 79 } | 81 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 DCHECK(!instance); | 177 DCHECK(!instance); |
| 176 } | 178 } |
| 177 | 179 |
| 178 // static | 180 // static |
| 179 WindowManager* WindowManager::GetInstance() { | 181 WindowManager* WindowManager::GetInstance() { |
| 180 DCHECK(instance); | 182 DCHECK(instance); |
| 181 return instance; | 183 return instance; |
| 182 } | 184 } |
| 183 | 185 |
| 184 } // namespace athena | 186 } // namespace athena |
| OLD | NEW |