| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura/test/test_activation_client.h" | 5 #include "ui/aura/test/test_activation_client.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 | 8 |
| 9 namespace aura { | 9 namespace aura { |
| 10 namespace test { | 10 namespace test { |
| 11 | 11 |
| 12 //////////////////////////////////////////////////////////////////////////////// | 12 //////////////////////////////////////////////////////////////////////////////// |
| 13 // TestActivationClient, public: | 13 // TestActivationClient, public: |
| 14 | 14 |
| 15 TestActivationClient::TestActivationClient() : active_window_(NULL) { | 15 TestActivationClient::TestActivationClient() : active_window_(NULL) { |
| 16 ActivationClient::SetActivationClient(this); | 16 client::SetActivationClient(this); |
| 17 } | 17 } |
| 18 | 18 |
| 19 TestActivationClient::~TestActivationClient() { | 19 TestActivationClient::~TestActivationClient() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 //////////////////////////////////////////////////////////////////////////////// | 22 //////////////////////////////////////////////////////////////////////////////// |
| 23 // TestActivationClient, ActivationClient implementation: | 23 // TestActivationClient, client::ActivationClient implementation: |
| 24 | 24 |
| 25 void TestActivationClient::ActivateWindow(Window* window) { | 25 void TestActivationClient::ActivateWindow(Window* window) { |
| 26 if (active_window_) | 26 if (active_window_) |
| 27 active_window_->RemoveObserver(this); | 27 active_window_->RemoveObserver(this); |
| 28 active_window_ = window; | 28 active_window_ = window; |
| 29 active_window_->AddObserver(this); | 29 active_window_->AddObserver(this); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void TestActivationClient::DeactivateWindow(Window* window) { | 32 void TestActivationClient::DeactivateWindow(Window* window) { |
| 33 if (window == active_window_) { | 33 if (window == active_window_) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 50 | 50 |
| 51 void TestActivationClient::OnWindowDestroyed(Window* window) { | 51 void TestActivationClient::OnWindowDestroyed(Window* window) { |
| 52 if (window == active_window_) { | 52 if (window == active_window_) { |
| 53 window->RemoveObserver(this); | 53 window->RemoveObserver(this); |
| 54 active_window_ = NULL; | 54 active_window_ = NULL; |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace test | 58 } // namespace test |
| 59 } // namespace aura | 59 } // namespace aura |
| OLD | NEW |