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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 void SetInOverview(bool active); | 51 void SetInOverview(bool active); |
52 | 52 |
53 void InstallAccelerators(); | 53 void InstallAccelerators(); |
54 | 54 |
55 // WindowManager: | 55 // WindowManager: |
56 virtual void AddObserver(WindowManagerObserver* observer) OVERRIDE; | 56 virtual void AddObserver(WindowManagerObserver* observer) OVERRIDE; |
57 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE; | 57 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE; |
58 | 58 |
59 // WindowOverviewModeDelegate: | 59 // WindowOverviewModeDelegate: |
60 virtual void OnSelectWindow(aura::Window* window) OVERRIDE; | 60 virtual void OnSelectWindow(aura::Window* window) OVERRIDE; |
61 virtual void OnSplitViewMode(aura::Window* left, | |
62 aura::Window* right) OVERRIDE; | |
61 | 63 |
62 // aura::WindowObserver | 64 // aura::WindowObserver |
63 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; | 65 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; |
64 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 66 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
65 | 67 |
66 // AcceleratorHandler: | 68 // AcceleratorHandler: |
67 virtual bool IsCommandEnabled(int command_id) const OVERRIDE; | 69 virtual bool IsCommandEnabled(int command_id) const OVERRIDE; |
68 virtual bool OnAcceleratorFired(int command_id, | 70 virtual bool OnAcceleratorFired(int command_id, |
69 const ui::Accelerator& accelerator) OVERRIDE; | 71 const ui::Accelerator& accelerator) OVERRIDE; |
70 | 72 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 void WindowManagerImpl::RemoveObserver(WindowManagerObserver* observer) { | 201 void WindowManagerImpl::RemoveObserver(WindowManagerObserver* observer) { |
200 observers_.RemoveObserver(observer); | 202 observers_.RemoveObserver(observer); |
201 } | 203 } |
202 | 204 |
203 void WindowManagerImpl::OnSelectWindow(aura::Window* window) { | 205 void WindowManagerImpl::OnSelectWindow(aura::Window* window) { |
204 mru_window_tracker_->MoveToFront(window); | 206 mru_window_tracker_->MoveToFront(window); |
205 wm::ActivateWindow(window); | 207 wm::ActivateWindow(window); |
206 SetInOverview(false); | 208 SetInOverview(false); |
207 } | 209 } |
208 | 210 |
211 void WindowManagerImpl::OnSplitViewMode(aura::Window* left, | |
212 aura::Window* right) { | |
213 SetInOverview(false); | |
mfomitchev
2014/08/13 15:12:31
Hmm.. my understanding from the mocks was that you
sadrul
2014/08/13 16:20:12
We are going with this for now. I clarified with k
mfomitchev
2014/08/13 17:42:52
I thought it was a bit ambiguous, so I responded o
| |
214 split_view_controller_->ActivateSplitMode(left, right); | |
215 } | |
216 | |
209 void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) { | 217 void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) { |
210 if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL) | 218 if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL) |
211 SetInOverview(false); | 219 SetInOverview(false); |
212 } | 220 } |
213 | 221 |
214 void WindowManagerImpl::OnWindowDestroying(aura::Window* window) { | 222 void WindowManagerImpl::OnWindowDestroying(aura::Window* window) { |
215 if (window == container_) | 223 if (window == container_) |
216 container_.reset(); | 224 container_.reset(); |
217 } | 225 } |
218 | 226 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 DCHECK(!instance); | 311 DCHECK(!instance); |
304 } | 312 } |
305 | 313 |
306 // static | 314 // static |
307 WindowManager* WindowManager::GetInstance() { | 315 WindowManager* WindowManager::GetInstance() { |
308 DCHECK(instance); | 316 DCHECK(instance); |
309 return instance; | 317 return instance; |
310 } | 318 } |
311 | 319 |
312 } // namespace athena | 320 } // namespace athena |
OLD | NEW |