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

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

Issue 317823002: Implement NativeViewHostAura::InstallClip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 6 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 | Annotate | Revision Log
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.h" 5 #include "ui/views/controls/native/native_view_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/cursor/cursor.h" 8 #include "ui/base/cursor/cursor.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/accessibility/native_view_accessibility.h" 10 #include "ui/views/accessibility/native_view_accessibility.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 void NativeViewHost::Attach(gfx::NativeView native_view) { 33 void NativeViewHost::Attach(gfx::NativeView native_view) {
34 DCHECK(native_view); 34 DCHECK(native_view);
35 DCHECK(!native_view_); 35 DCHECK(!native_view_);
36 native_view_ = native_view; 36 native_view_ = native_view;
37 // If set_focus_view() has not been invoked, this view is the one that should 37 // If set_focus_view() has not been invoked, this view is the one that should
38 // be seen as focused when the native view receives focus. 38 // be seen as focused when the native view receives focus.
39 if (!focus_view_) 39 if (!focus_view_)
40 focus_view_ = this; 40 focus_view_ = this;
41 native_wrapper_->NativeViewWillAttach(); 41 native_wrapper_->AttachNativeView();
42 Widget::ReparentNativeView(native_view_, GetWidget()->GetNativeView());
43 Layout(); 42 Layout();
44 43
45 Widget* widget = Widget::GetWidgetForNativeView(native_view); 44 Widget* widget = Widget::GetWidgetForNativeView(native_view);
46 if (widget) 45 if (widget)
47 widget->SetNativeWindowProperty(kWidgetNativeViewHostKey, this); 46 widget->SetNativeWindowProperty(kWidgetNativeViewHostKey, this);
48 } 47 }
49 48
50 void NativeViewHost::Detach() { 49 void NativeViewHost::Detach() {
51 Detach(false); 50 Detach(false);
52 } 51 }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 Widget::Widgets widgets; 214 Widget::Widgets widgets;
216 Widget::GetAllChildWidgets(native_view(), &widgets); 215 Widget::GetAllChildWidgets(native_view(), &widgets);
217 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) { 216 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) {
218 focus_manager->ViewRemoved((*i)->GetRootView()); 217 focus_manager->ViewRemoved((*i)->GetRootView());
219 if (!focus_manager->GetFocusedView()) 218 if (!focus_manager->GetFocusedView())
220 return; 219 return;
221 } 220 }
222 } 221 }
223 222
224 } // namespace views 223 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698