Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: ui/views/controls/native/native_view_host_aura.cc

Issue 564553002: When we switch tabs in chrome, the tab being switched away from gets hidden/shown/hidden. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed RemoveClippingWindowOrder views test Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/controls/native/native_view_host_aura.h" 5 #include "ui/views/controls/native/native_view_host_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/client/focus_client.h" 9 #include "ui/aura/client/focus_client.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void NativeViewHostAura::AttachNativeView() { 90 void NativeViewHostAura::AttachNativeView() {
91 clipping_window_delegate_->set_native_view(host_->native_view()); 91 clipping_window_delegate_->set_native_view(host_->native_view());
92 host_->native_view()->AddObserver(this); 92 host_->native_view()->AddObserver(this);
93 host_->native_view()->SetProperty(views::kHostViewKey, 93 host_->native_view()->SetProperty(views::kHostViewKey,
94 static_cast<View*>(host_)); 94 static_cast<View*>(host_));
95 AddClippingWindow(); 95 AddClippingWindow();
96 } 96 }
97 97
98 void NativeViewHostAura::NativeViewDetaching(bool destroyed) { 98 void NativeViewHostAura::NativeViewDetaching(bool destroyed) {
99 clipping_window_delegate_->set_native_view(NULL); 99 clipping_window_delegate_->set_native_view(NULL);
100 if (!destroyed)
101 host_->native_view()->Hide();
sky 2014/09/11 16:03:19 Why do we need to hide at all here?
ananta 2014/09/11 16:21:07 If we don't hide it the WCVA code which listens fo
sky 2014/09/11 16:43:36 Here's what the code for windows did eons ago: vo
102
100 RemoveClippingWindow(); 103 RemoveClippingWindow();
104
101 if (!destroyed) { 105 if (!destroyed) {
102 host_->native_view()->RemoveObserver(this); 106 host_->native_view()->RemoveObserver(this);
103 host_->native_view()->ClearProperty(views::kHostViewKey); 107 host_->native_view()->ClearProperty(views::kHostViewKey);
104 host_->native_view()->ClearProperty(aura::client::kHostWindowKey); 108 host_->native_view()->ClearProperty(aura::client::kHostWindowKey);
105 host_->native_view()->Hide();
106 if (host_->native_view()->parent()) 109 if (host_->native_view()->parent())
107 Widget::ReparentNativeView(host_->native_view(), NULL); 110 Widget::ReparentNativeView(host_->native_view(), NULL);
108 } 111 }
109 } 112 }
110 113
111 void NativeViewHostAura::AddedToWidget() { 114 void NativeViewHostAura::AddedToWidget() {
112 if (!host_->native_view()) 115 if (!host_->native_view())
113 return; 116 return;
114 117
115 AddClippingWindow(); 118 AddClippingWindow();
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } else { 229 } else {
227 clipping_window_.RemoveChild(host_->native_view()); 230 clipping_window_.RemoveChild(host_->native_view());
228 } 231 }
229 host_->native_view()->SetBounds(clipping_window_.bounds()); 232 host_->native_view()->SetBounds(clipping_window_.bounds());
230 } 233 }
231 if (clipping_window_.parent()) 234 if (clipping_window_.parent())
232 clipping_window_.parent()->RemoveChild(&clipping_window_); 235 clipping_window_.parent()->RemoveChild(&clipping_window_);
233 } 236 }
234 237
235 } // namespace views 238 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698