| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/activation_controller.h" | 5 #include "ash/wm/activation_controller.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/activation_controller_delegate.h" | 10 #include "ash/wm/activation_controller_delegate.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 //////////////////////////////////////////////////////////////////////////////// | 143 //////////////////////////////////////////////////////////////////////////////// |
| 144 // ActivationController, public: | 144 // ActivationController, public: |
| 145 | 145 |
| 146 ActivationController::ActivationController( | 146 ActivationController::ActivationController( |
| 147 aura::client::FocusClient* focus_client, | 147 aura::client::FocusClient* focus_client, |
| 148 ActivationControllerDelegate* delegate) | 148 ActivationControllerDelegate* delegate) |
| 149 : focus_client_(focus_client), | 149 : focus_client_(focus_client), |
| 150 updating_activation_(false), | 150 updating_activation_(false), |
| 151 active_window_(NULL), | 151 active_window_(NULL), |
| 152 ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)), | 152 observer_manager_(this), |
| 153 delegate_(delegate) { | 153 delegate_(delegate) { |
| 154 aura::Env::GetInstance()->AddObserver(this); | 154 aura::Env::GetInstance()->AddObserver(this); |
| 155 focus_client_->AddObserver(this); | 155 focus_client_->AddObserver(this); |
| 156 } | 156 } |
| 157 | 157 |
| 158 ActivationController::~ActivationController() { | 158 ActivationController::~ActivationController() { |
| 159 aura::Env::GetInstance()->RemoveObserver(this); | 159 aura::Env::GetInstance()->RemoveObserver(this); |
| 160 focus_client_->RemoveObserver(this); | 160 focus_client_->RemoveObserver(this); |
| 161 } | 161 } |
| 162 | 162 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 aura::Window* window = static_cast<aura::Window*>(event->target()); | 423 aura::Window* window = static_cast<aura::Window*>(event->target()); |
| 424 window = delegate_->WillFocusWindow(window); | 424 window = delegate_->WillFocusWindow(window); |
| 425 if (GetActiveWindow() != window) { | 425 if (GetActiveWindow() != window) { |
| 426 aura::client::GetFocusClient(window)->FocusWindow( | 426 aura::client::GetFocusClient(window)->FocusWindow( |
| 427 FindFocusableWindowFor(window)); | 427 FindFocusableWindowFor(window)); |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace internal | 431 } // namespace internal |
| 432 } // namespace ash | 432 } // namespace ash |
| OLD | NEW |