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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 void WindowManagerImpl::RemoveObserver(WindowManagerObserver* observer) { | 206 void WindowManagerImpl::RemoveObserver(WindowManagerObserver* observer) { |
205 observers_.RemoveObserver(observer); | 207 observers_.RemoveObserver(observer); |
206 } | 208 } |
207 | 209 |
208 void WindowManagerImpl::OnSelectWindow(aura::Window* window) { | 210 void WindowManagerImpl::OnSelectWindow(aura::Window* window) { |
209 mru_window_tracker_->MoveToFront(window); | 211 mru_window_tracker_->MoveToFront(window); |
210 wm::ActivateWindow(window); | 212 wm::ActivateWindow(window); |
211 SetInOverview(false); | 213 SetInOverview(false); |
212 } | 214 } |
213 | 215 |
| 216 void WindowManagerImpl::OnSplitViewMode(aura::Window* left, |
| 217 aura::Window* right) { |
| 218 SetInOverview(false); |
| 219 split_view_controller_->ActivateSplitMode(left, right); |
| 220 } |
| 221 |
214 void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) { | 222 void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) { |
215 if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL) | 223 if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL) |
216 SetInOverview(false); | 224 SetInOverview(false); |
217 } | 225 } |
218 | 226 |
219 void WindowManagerImpl::OnWindowDestroying(aura::Window* window) { | 227 void WindowManagerImpl::OnWindowDestroying(aura::Window* window) { |
220 if (window == container_) | 228 if (window == container_) |
221 container_.reset(); | 229 container_.reset(); |
222 } | 230 } |
223 | 231 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 DCHECK(!instance); | 316 DCHECK(!instance); |
309 } | 317 } |
310 | 318 |
311 // static | 319 // static |
312 WindowManager* WindowManager::GetInstance() { | 320 WindowManager* WindowManager::GetInstance() { |
313 DCHECK(instance); | 321 DCHECK(instance); |
314 return instance; | 322 return instance; |
315 } | 323 } |
316 | 324 |
317 } // namespace athena | 325 } // namespace athena |
OLD | NEW |