OLD | NEW |
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 "content/browser/web_contents/web_contents_view_gtk.h" | 5 #include "content/browser/web_contents/web_contents_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 void WebContentsViewGtk::GotFocus() { | 284 void WebContentsViewGtk::GotFocus() { |
285 // This is only used in the views FocusManager stuff but it bleeds through | 285 // This is only used in the views FocusManager stuff but it bleeds through |
286 // all subclasses. http://crbug.com/21875 | 286 // all subclasses. http://crbug.com/21875 |
287 } | 287 } |
288 | 288 |
289 // This is called when the renderer asks us to take focus back (i.e., it has | 289 // This is called when the renderer asks us to take focus back (i.e., it has |
290 // iterated past the last focusable element on the page). | 290 // iterated past the last focusable element on the page). |
291 void WebContentsViewGtk::TakeFocus(bool reverse) { | 291 void WebContentsViewGtk::TakeFocus(bool reverse) { |
292 if (!web_contents_->GetDelegate()) | 292 if (!web_contents_->GetDelegate()) |
293 return; | 293 return; |
294 if (!web_contents_->GetDelegate()->TakeFocus(reverse)) { | 294 if (!web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) { |
295 gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()), | 295 gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()), |
296 reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD); | 296 reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 void WebContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { | 300 void WebContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { |
301 gtk_container_add(GTK_CONTAINER(expanded_.get()), widget); | 301 gtk_container_add(GTK_CONTAINER(expanded_.get()), widget); |
302 } | 302 } |
303 | 303 |
304 // Called when the content view gtk widget is tabbed to, or after the call to | 304 // Called when the content view gtk widget is tabbed to, or after the call to |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 // We manually tell our RWHV to resize the renderer content. This avoids | 387 // We manually tell our RWHV to resize the renderer content. This avoids |
388 // spurious resizes from GTK+. | 388 // spurious resizes from GTK+. |
389 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 389 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
390 if (rwhv) | 390 if (rwhv) |
391 rwhv->SetSize(size); | 391 rwhv->SetSize(size); |
392 if (web_contents_->GetInterstitialPage()) | 392 if (web_contents_->GetInterstitialPage()) |
393 web_contents_->GetInterstitialPage()->SetSize(size); | 393 web_contents_->GetInterstitialPage()->SetSize(size); |
394 } | 394 } |
395 | 395 |
396 } // namespace content | 396 } // namespace content |
OLD | NEW |