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 |
11 namespace views { | 11 namespace views { |
12 | 12 |
13 NativeWidgetAuraWindowObserver::NativeWidgetAuraWindowObserver( | 13 NativeWidgetAuraWindowObserver::NativeWidgetAuraWindowObserver( |
14 gfx::NativeView native_view, | 14 gfx::NativeView native_view, |
15 internal::NativeWidgetDelegate* delegate) | 15 internal::NativeWidgetDelegate* delegate) |
16 : native_view_(native_view), | 16 : ActivationChangeShim(native_view->GetRootWindow()), |
| 17 native_view_(native_view), |
17 delegate_(delegate) { | 18 delegate_(delegate) { |
18 native_view_->GetRootWindow()->AddObserver(this); | 19 native_view_->GetRootWindow()->AddObserver(this); |
19 native_view_->AddObserver(this); | 20 native_view_->AddObserver(this); |
20 aura::client::GetActivationClient(native_view_->GetRootWindow())-> | 21 aura::client::GetActivationClient(native_view_->GetRootWindow())-> |
21 AddObserver(this); | 22 AddObserver(this); |
22 } | 23 } |
23 | 24 |
24 NativeWidgetAuraWindowObserver::~NativeWidgetAuraWindowObserver() { | 25 NativeWidgetAuraWindowObserver::~NativeWidgetAuraWindowObserver() { |
25 CleanUpObservers(); | 26 CleanUpObservers(); |
26 } | 27 } |
(...skipping 17 matching lines...) Expand all Loading... |
44 if (!native_view_) | 45 if (!native_view_) |
45 return; | 46 return; |
46 native_view_->GetRootWindow()->RemoveObserver(this); | 47 native_view_->GetRootWindow()->RemoveObserver(this); |
47 native_view_->RemoveObserver(this); | 48 native_view_->RemoveObserver(this); |
48 aura::client::GetActivationClient(native_view_->GetRootWindow())-> | 49 aura::client::GetActivationClient(native_view_->GetRootWindow())-> |
49 RemoveObserver(this); | 50 RemoveObserver(this); |
50 native_view_ = NULL; | 51 native_view_ = NULL; |
51 } | 52 } |
52 | 53 |
53 } // namespace views | 54 } // namespace views |
OLD | NEW |