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

Unified Diff: views/widget/widget_gtk.cc

Issue 200035: First cut at implementation of FindBar for views / gtk... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« views/controls/textfield/textfield.h ('K') | « views/widget/root_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_gtk.cc
===================================================================
--- views/widget/widget_gtk.cc (revision 25765)
+++ views/widget/widget_gtk.cc (working copy)
@@ -295,7 +295,6 @@
if (type_ == TYPE_CHILD) {
if (parent) {
WidgetGtk* parent_widget = GetViewForNative(parent);
- parent_widget->AddChild(widget_);
parent_widget->PositionChild(widget_, bounds.x(), bounds.y(),
bounds.width(), bounds.height());
}
@@ -459,7 +458,16 @@
}
FocusManager* WidgetGtk::GetFocusManager() {
- return focus_manager_.get();
+ if (focus_manager_.get())
+ return focus_manager_.get();
+
+ Widget* root = GetRootWidget();
+ if (root && root != this) {
+ // Widget subclasses may override GetFocusManager(), for example for
+ // dealing with cases where the widget has been unparented.
+ return root->GetFocusManager();
+ }
+ return NULL;
}
void WidgetGtk::ViewHierarchyChanged(bool is_add, View *parent,
« views/controls/textfield/textfield.h ('K') | « views/widget/root_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698