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

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

Issue 517143003: Hide NativeViewHostAura correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add 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
« no previous file with comments | « no previous file | ui/views/controls/native/native_view_host_aura_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 : gfx::Rect(x, y, w, h)); 157 : gfx::Rect(x, y, w, h));
158 158
159 gfx::Point clip_offset = clipping_window_.bounds().origin(); 159 gfx::Point clip_offset = clipping_window_.bounds().origin();
160 host_->native_view()->SetBounds( 160 host_->native_view()->SetBounds(
161 gfx::Rect(x - clip_offset.x(), y - clip_offset.y(), width, height)); 161 gfx::Rect(x - clip_offset.x(), y - clip_offset.y(), width, height));
162 host_->native_view()->Show(); 162 host_->native_view()->Show();
163 clipping_window_.Show(); 163 clipping_window_.Show();
164 } 164 }
165 165
166 void NativeViewHostAura::HideWidget() { 166 void NativeViewHostAura::HideWidget() {
167 host_->native_view()->Hide(); 167 host_->native_view()->Hide();
sky 2014/09/02 15:19:37 We may not need the Hide/Show on native_view() any
calamity 2014/09/03 00:44:22 Acknowledged.
168 clipping_window_.Hide();
168 } 169 }
169 170
170 void NativeViewHostAura::SetFocus() { 171 void NativeViewHostAura::SetFocus() {
171 aura::Window* window = host_->native_view(); 172 aura::Window* window = host_->native_view();
172 aura::client::FocusClient* client = aura::client::GetFocusClient(window); 173 aura::client::FocusClient* client = aura::client::GetFocusClient(window);
173 if (client) 174 if (client)
174 client->FocusWindow(window); 175 client->FocusWindow(window);
175 } 176 }
176 177
177 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() { 178 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } else { 226 } else {
226 clipping_window_.RemoveChild(host_->native_view()); 227 clipping_window_.RemoveChild(host_->native_view());
227 } 228 }
228 host_->native_view()->SetBounds(clipping_window_.bounds()); 229 host_->native_view()->SetBounds(clipping_window_.bounds());
229 } 230 }
230 if (clipping_window_.parent()) 231 if (clipping_window_.parent())
231 clipping_window_.parent()->RemoveChild(&clipping_window_); 232 clipping_window_.parent()->RemoveChild(&clipping_window_);
232 } 233 }
233 234
234 } // namespace views 235 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/native/native_view_host_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698