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/desktop/desktop_activation_client.h" | 5 #include "ui/aura/desktop/desktop_activation_client.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/aura/client/activation_delegate.h" | 9 #include "ui/aura/client/activation_delegate.h" |
10 #include "ui/aura/client/activation_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void DesktopActivationClient::DeactivateWindow(Window* window) { | 90 void DesktopActivationClient::DeactivateWindow(Window* window) { |
91 if (window == current_active_) | 91 if (window == current_active_) |
92 current_active_ = NULL; | 92 current_active_ = NULL; |
93 } | 93 } |
94 | 94 |
95 Window* DesktopActivationClient::GetActiveWindow() { | 95 Window* DesktopActivationClient::GetActiveWindow() { |
96 return current_active_; | 96 return current_active_; |
97 } | 97 } |
98 | 98 |
99 bool DesktopActivationClient::OnWillFocusWindow(Window* window, | 99 bool DesktopActivationClient::OnWillFocusWindow(Window* window, |
100 const Event* event) { | 100 const ui::Event* event) { |
101 return CanActivateWindow(GetActivatableWindow(window)); | 101 return CanActivateWindow(GetActivatableWindow(window)); |
102 } | 102 } |
103 | 103 |
104 void DesktopActivationClient::OnWindowDestroying(aura::Window* window) { | 104 void DesktopActivationClient::OnWindowDestroying(aura::Window* window) { |
105 if (current_active_ == window) { | 105 if (current_active_ == window) { |
106 current_active_ = NULL; | 106 current_active_ = NULL; |
107 FOR_EACH_OBSERVER(aura::client::ActivationChangeObserver, | 107 FOR_EACH_OBSERVER(aura::client::ActivationChangeObserver, |
108 observers_, | 108 observers_, |
109 OnWindowActivated(NULL, window)); | 109 OnWindowActivated(NULL, window)); |
110 | 110 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // that path instead. | 144 // that path instead. |
145 if (child->transient_parent()) | 145 if (child->transient_parent()) |
146 return GetActivatableWindow(child->transient_parent()); | 146 return GetActivatableWindow(child->transient_parent()); |
147 parent = parent->parent(); | 147 parent = parent->parent(); |
148 child = child->parent(); | 148 child = child->parent(); |
149 } | 149 } |
150 return NULL; | 150 return NULL; |
151 } | 151 } |
152 | 152 |
153 } // namespace aura | 153 } // namespace aura |
OLD | NEW |