| 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/views/widget/native_widget_aura_window_observer.h" | 5 #include "ui/views/widget/native_widget_aura_window_observer.h" |
| 6 | 6 |
| 7 #include "ui/aura/client/activation_client.h" | 7 #include "ui/aura/client/activation_client.h" |
| 8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 CleanUpObservers(); | 25 CleanUpObservers(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void NativeWidgetAuraWindowObserver::OnWindowActivated( | 28 void NativeWidgetAuraWindowObserver::OnWindowActivated( |
| 29 aura::Window* gained_active, | 29 aura::Window* gained_active, |
| 30 aura::Window* lost_active) { | 30 aura::Window* lost_active) { |
| 31 if (!gained_active || gained_active->transient_parent() != native_view_) | 31 if (!gained_active || gained_active->transient_parent() != native_view_) |
| 32 delegate_->EnableInactiveRendering(); | 32 delegate_->EnableInactiveRendering(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void NativeWidgetAuraWindowObserver::OnWindowActivationRequestCompleted( |
| 36 aura::Window* request_active, aura::Window* actual_active) { |
| 37 } |
| 38 |
| 35 void NativeWidgetAuraWindowObserver::OnWindowRemovingFromRootWindow( | 39 void NativeWidgetAuraWindowObserver::OnWindowRemovingFromRootWindow( |
| 36 aura::Window* window) { | 40 aura::Window* window) { |
| 37 if (window != native_view_) | 41 if (window != native_view_) |
| 38 return; | 42 return; |
| 39 CleanUpObservers(); | 43 CleanUpObservers(); |
| 40 } | 44 } |
| 41 | 45 |
| 42 void NativeWidgetAuraWindowObserver::CleanUpObservers() { | 46 void NativeWidgetAuraWindowObserver::CleanUpObservers() { |
| 43 if (!native_view_) | 47 if (!native_view_) |
| 44 return; | 48 return; |
| 45 native_view_->GetRootWindow()->RemoveObserver(this); | 49 native_view_->GetRootWindow()->RemoveObserver(this); |
| 46 native_view_->RemoveObserver(this); | 50 native_view_->RemoveObserver(this); |
| 47 aura::client::GetActivationClient(native_view_->GetRootWindow())-> | 51 aura::client::GetActivationClient(native_view_->GetRootWindow())-> |
| 48 RemoveObserver(this); | 52 RemoveObserver(this); |
| 49 native_view_ = NULL; | 53 native_view_ = NULL; |
| 50 } | 54 } |
| 51 | 55 |
| 52 } // namespace views | 56 } // namespace views |
| OLD | NEW |