| 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 "ui/aura/test/test_activation_client.h" | 5 #include "ui/aura/test/test_activation_client.h" |
| 6 | 6 |
| 7 #include "ui/aura/client/activation_change_observer.h" | 7 #include "ui/aura/client/activation_change_observer.h" |
| 8 #include "ui/aura/client/activation_delegate.h" | 8 #include "ui/aura/client/activation_delegate.h" |
| 9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 observers_.RemoveObserver(observer); | 38 observers_.RemoveObserver(observer); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void TestActivationClient::ActivateWindow(Window* window) { | 41 void TestActivationClient::ActivateWindow(Window* window) { |
| 42 Window* last_active = GetActiveWindow(); | 42 Window* last_active = GetActiveWindow(); |
| 43 if (last_active == window) | 43 if (last_active == window) |
| 44 return; | 44 return; |
| 45 | 45 |
| 46 RemoveActiveWindow(window); | 46 RemoveActiveWindow(window); |
| 47 active_windows_.push_back(window); | 47 active_windows_.push_back(window); |
| 48 window->parent()->StackChildAtTop(window); |
| 48 window->AddObserver(this); | 49 window->AddObserver(this); |
| 49 | 50 |
| 50 FOR_EACH_OBSERVER(client::ActivationChangeObserver, | 51 FOR_EACH_OBSERVER(client::ActivationChangeObserver, |
| 51 observers_, | 52 observers_, |
| 52 OnWindowActivated(window, last_active)); | 53 OnWindowActivated(window, last_active)); |
| 53 | 54 |
| 54 if (aura::client::GetActivationDelegate(window)) | 55 if (aura::client::GetActivationDelegate(window)) |
| 55 aura::client::GetActivationDelegate(window)->OnActivated(); | 56 aura::client::GetActivationDelegate(window)->OnActivated(); |
| 56 | 57 |
| 57 if (last_active && aura::client::GetActivationDelegate(last_active)) | 58 if (last_active && aura::client::GetActivationDelegate(last_active)) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (active_windows_[i] == window) { | 104 if (active_windows_[i] == window) { |
| 104 active_windows_.erase(active_windows_.begin() + i); | 105 active_windows_.erase(active_windows_.begin() + i); |
| 105 window->RemoveObserver(this); | 106 window->RemoveObserver(this); |
| 106 return; | 107 return; |
| 107 } | 108 } |
| 108 } | 109 } |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace test | 112 } // namespace test |
| 112 } // namespace aura | 113 } // namespace aura |
| OLD | NEW |