| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "athena/common/container_priorities.h" | 9 #include "athena/common/container_priorities.h" |
| 10 #include "athena/input/public/accelerator_manager.h" | 10 #include "athena/input/public/accelerator_manager.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void SetInOverview(bool active); | 53 void SetInOverview(bool active); |
| 54 | 54 |
| 55 void InstallAccelerators(); | 55 void InstallAccelerators(); |
| 56 | 56 |
| 57 // WindowManager: | 57 // WindowManager: |
| 58 virtual void AddObserver(WindowManagerObserver* observer) OVERRIDE; | 58 virtual void AddObserver(WindowManagerObserver* observer) OVERRIDE; |
| 59 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE; | 59 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE; |
| 60 | 60 |
| 61 // WindowOverviewModeDelegate: | 61 // WindowOverviewModeDelegate: |
| 62 virtual void OnSelectWindow(aura::Window* window) OVERRIDE; | 62 virtual void OnSelectWindow(aura::Window* window) OVERRIDE; |
| 63 virtual void OnSplitViewMode(aura::Window* left, |
| 64 aura::Window* right) OVERRIDE; |
| 63 | 65 |
| 64 // aura::WindowObserver | 66 // aura::WindowObserver |
| 65 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; | 67 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; |
| 66 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 68 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 67 | 69 |
| 68 // AcceleratorHandler: | 70 // AcceleratorHandler: |
| 69 virtual bool IsCommandEnabled(int command_id) const OVERRIDE; | 71 virtual bool IsCommandEnabled(int command_id) const OVERRIDE; |
| 70 virtual bool OnAcceleratorFired(int command_id, | 72 virtual bool OnAcceleratorFired(int command_id, |
| 71 const ui::Accelerator& accelerator) OVERRIDE; | 73 const ui::Accelerator& accelerator) OVERRIDE; |
| 72 | 74 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void WindowManagerImpl::RemoveObserver(WindowManagerObserver* observer) { | 207 void WindowManagerImpl::RemoveObserver(WindowManagerObserver* observer) { |
| 206 observers_.RemoveObserver(observer); | 208 observers_.RemoveObserver(observer); |
| 207 } | 209 } |
| 208 | 210 |
| 209 void WindowManagerImpl::OnSelectWindow(aura::Window* window) { | 211 void WindowManagerImpl::OnSelectWindow(aura::Window* window) { |
| 210 mru_window_tracker_->MoveToFront(window); | 212 mru_window_tracker_->MoveToFront(window); |
| 211 wm::ActivateWindow(window); | 213 wm::ActivateWindow(window); |
| 212 SetInOverview(false); | 214 SetInOverview(false); |
| 213 } | 215 } |
| 214 | 216 |
| 217 void WindowManagerImpl::OnSplitViewMode(aura::Window* left, |
| 218 aura::Window* right) { |
| 219 SetInOverview(false); |
| 220 split_view_controller_->ActivateSplitMode(left, right); |
| 221 } |
| 222 |
| 215 void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) { | 223 void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) { |
| 216 if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL) | 224 if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL) |
| 217 SetInOverview(false); | 225 SetInOverview(false); |
| 218 } | 226 } |
| 219 | 227 |
| 220 void WindowManagerImpl::OnWindowDestroying(aura::Window* window) { | 228 void WindowManagerImpl::OnWindowDestroying(aura::Window* window) { |
| 221 if (window == container_) | 229 if (window == container_) |
| 222 container_.reset(); | 230 container_.reset(); |
| 223 } | 231 } |
| 224 | 232 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 DCHECK(!instance); | 317 DCHECK(!instance); |
| 310 } | 318 } |
| 311 | 319 |
| 312 // static | 320 // static |
| 313 WindowManager* WindowManager::GetInstance() { | 321 WindowManager* WindowManager::GetInstance() { |
| 314 DCHECK(instance); | 322 DCHECK(instance); |
| 315 return instance; | 323 return instance; |
| 316 } | 324 } |
| 317 | 325 |
| 318 } // namespace athena | 326 } // namespace athena |
| OLD | NEW |