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

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

Issue 2812056: Relanding http://codereview.chromium.org/2870050/show. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: rebased 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
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 // TODO(estade): it doesn't seem like the CanBlur() check should be necessary 606 host_->Blur();
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();
611 } 607 }
612 608
613 bool RenderWidgetHostViewGtk::HasFocus() { 609 bool RenderWidgetHostViewGtk::HasFocus() {
614 return gtk_widget_is_focus(view_.get()); 610 return gtk_widget_is_focus(view_.get());
615 } 611 }
616 612
617 void RenderWidgetHostViewGtk::Show() { 613 void RenderWidgetHostViewGtk::Show() {
618 gtk_widget_show(view_.get()); 614 gtk_widget_show(view_.get());
619 } 615 }
620 616
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 } 977 }
982 978
983 // static 979 // static
984 RenderWidgetHostView* 980 RenderWidgetHostView*
985 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( 981 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView(
986 gfx::NativeView widget) { 982 gfx::NativeView widget) {
987 gpointer user_data = g_object_get_data(G_OBJECT(widget), 983 gpointer user_data = g_object_get_data(G_OBJECT(widget),
988 kRenderWidgetHostViewKey); 984 kRenderWidgetHostViewKey);
989 return reinterpret_cast<RenderWidgetHostView*>(user_data); 985 return reinterpret_cast<RenderWidgetHostView*>(user_data);
990 } 986 }
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