| 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/screen/public/screen_manager.h" | 7 #include "athena/screen/public/screen_manager.h" |
| 8 #include "athena/wm/debug/debug_window.h" |
| 8 #include "athena/wm/window_overview_mode.h" | 9 #include "athena/wm/window_overview_mode.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "ui/aura/layout_manager.h" | 11 #include "ui/aura/layout_manager.h" |
| 11 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 12 #include "ui/wm/public/window_types.h" | 13 #include "ui/wm/public/window_types.h" |
| 13 | 14 |
| 14 namespace athena { | 15 namespace athena { |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 class WindowManagerImpl : public WindowManager, | 18 class WindowManagerImpl : public WindowManager, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 DISALLOW_COPY_AND_ASSIGN(TempEventHandler); | 100 DISALLOW_COPY_AND_ASSIGN(TempEventHandler); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 WindowManagerImpl::WindowManagerImpl() | 103 WindowManagerImpl::WindowManagerImpl() |
| 103 : container_(ScreenManager::Get()->CreateDefaultContainer("MainContainer")), | 104 : container_(ScreenManager::Get()->CreateDefaultContainer("MainContainer")), |
| 104 temp_handler_(new TempEventHandler()) { | 105 temp_handler_(new TempEventHandler()) { |
| 105 container_->SetLayoutManager(new AthenaContainerLayoutManager); | 106 container_->SetLayoutManager(new AthenaContainerLayoutManager); |
| 106 container_->AddObserver(this); | 107 container_->AddObserver(this); |
| 107 container_->AddPreTargetHandler(temp_handler_.get()); | 108 container_->AddPreTargetHandler(temp_handler_.get()); |
| 108 instance = this; | 109 instance = this; |
| 110 |
| 111 CreateDebugWindow(); |
| 109 } | 112 } |
| 110 | 113 |
| 111 WindowManagerImpl::~WindowManagerImpl() { | 114 WindowManagerImpl::~WindowManagerImpl() { |
| 112 if (container_) { | 115 if (container_) { |
| 113 container_->RemovePreTargetHandler(temp_handler_.get()); | 116 container_->RemovePreTargetHandler(temp_handler_.get()); |
| 114 container_->RemoveObserver(this); | 117 container_->RemoveObserver(this); |
| 115 } | 118 } |
| 116 container_.reset(); | 119 container_.reset(); |
| 117 instance = NULL; | 120 instance = NULL; |
| 118 } | 121 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 142 } | 145 } |
| 143 | 146 |
| 144 // static | 147 // static |
| 145 void WindowManager::Shutdown() { | 148 void WindowManager::Shutdown() { |
| 146 DCHECK(instance); | 149 DCHECK(instance); |
| 147 delete instance; | 150 delete instance; |
| 148 DCHECK(!instance); | 151 DCHECK(!instance); |
| 149 } | 152 } |
| 150 | 153 |
| 151 } // namespace athena | 154 } // namespace athena |
| OLD | NEW |