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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 3033004: Revert 52600 - renderer_host: Remove CanBlur method.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host_view_gtk.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
6 6
7 // If this gets included after the gtk headers, then a bunch of compiler 7 // If this gets included after the gtk headers, then a bunch of compiler
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts
9 // badly with URLRequestStatus::Status. 9 // badly with URLRequestStatus::Status.
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 } 596 }
597 } 597 }
598 598
599 void RenderWidgetHostViewGtk::Focus() { 599 void RenderWidgetHostViewGtk::Focus() {
600 gtk_widget_grab_focus(view_.get()); 600 gtk_widget_grab_focus(view_.get());
601 } 601 }
602 602
603 void RenderWidgetHostViewGtk::Blur() { 603 void RenderWidgetHostViewGtk::Blur() {
604 // TODO(estade): We should be clearing native focus as well, but I know of no 604 // TODO(estade): We should be clearing native focus as well, but I know of no
605 // way to do that without focusing another widget. 605 // way to do that without focusing another widget.
606 host_->Blur(); 606 // TODO(estade): it doesn't seem like the CanBlur() check should be necessary
607 // since we are only called in response to a ViewHost blur message, but this
608 // check is made on Windows so I've added it here as well.
609 if (host_->CanBlur())
610 host_->Blur();
607 } 611 }
608 612
609 bool RenderWidgetHostViewGtk::HasFocus() { 613 bool RenderWidgetHostViewGtk::HasFocus() {
610 return gtk_widget_is_focus(view_.get()); 614 return gtk_widget_is_focus(view_.get());
611 } 615 }
612 616
613 void RenderWidgetHostViewGtk::Show() { 617 void RenderWidgetHostViewGtk::Show() {
614 gtk_widget_show(view_.get()); 618 gtk_widget_show(view_.get());
615 } 619 }
616 620
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 } 981 }
978 982
979 // static 983 // static
980 RenderWidgetHostView* 984 RenderWidgetHostView*
981 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( 985 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView(
982 gfx::NativeView widget) { 986 gfx::NativeView widget) {
983 gpointer user_data = g_object_get_data(G_OBJECT(widget), 987 gpointer user_data = g_object_get_data(G_OBJECT(widget),
984 kRenderWidgetHostViewKey); 988 kRenderWidgetHostViewKey);
985 return reinterpret_cast<RenderWidgetHostView*>(user_data); 989 return reinterpret_cast<RenderWidgetHostView*>(user_data);
986 } 990 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.h ('k') | chrome/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698