Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_contents_view_gtk.h" | 5 #include "chrome/browser/tab_contents/tab_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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 | 262 |
| 263 void TabContentsViewGtk::UpdateDragCursor(WebDragOperation operation) { | 263 void TabContentsViewGtk::UpdateDragCursor(WebDragOperation operation) { |
| 264 drag_dest_->UpdateDragStatus(operation); | 264 drag_dest_->UpdateDragStatus(operation); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void TabContentsViewGtk::GotFocus() { | 267 void TabContentsViewGtk::GotFocus() { |
| 268 // This is only used in the views FocusManager stuff but it bleeds through | 268 // This is only used in the views FocusManager stuff but it bleeds through |
| 269 // all subclasses. http://crbug.com/21875 | 269 // all subclasses. http://crbug.com/21875 |
| 270 } | 270 } |
| 271 | 271 |
| 272 // This is called when we the renderer asks us to take focus back (i.e., it has | 272 // This is called when we the renderer asks us to take focus back (i.e., it has |
|
Lei Zhang
2011/11/16 21:52:06
s/when we/when /
| |
| 273 // iterated past the last focusable element on the page). | 273 // iterated past the last focusable element on the page). |
| 274 void TabContentsViewGtk::TakeFocus(bool reverse) { | 274 void TabContentsViewGtk::TakeFocus(bool reverse) { |
| 275 if (!tab_contents_->delegate()) | |
| 276 return; | |
| 275 if (!tab_contents_->delegate()->TakeFocus(reverse)) { | 277 if (!tab_contents_->delegate()->TakeFocus(reverse)) { |
| 276 gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()), | 278 gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()), |
| 277 reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD); | 279 reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD); |
| 278 } | 280 } |
| 279 } | 281 } |
| 280 | 282 |
| 281 void TabContentsViewGtk::SetDragDestDelegate( | 283 void TabContentsViewGtk::SetDragDestDelegate( |
| 282 content::WebDragDestDelegate* delegate) { | 284 content::WebDragDestDelegate* delegate) { |
| 283 drag_dest_->set_delegate(delegate); | 285 drag_dest_->set_delegate(delegate); |
| 284 } | 286 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 requested_size_ = size; | 408 requested_size_ = size; |
| 407 | 409 |
| 408 // We manually tell our RWHV to resize the renderer content. This avoids | 410 // We manually tell our RWHV to resize the renderer content. This avoids |
| 409 // spurious resizes from GTK+. | 411 // spurious resizes from GTK+. |
| 410 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); | 412 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); |
| 411 if (rwhv) | 413 if (rwhv) |
| 412 rwhv->SetSize(size); | 414 rwhv->SetSize(size); |
| 413 if (tab_contents_->interstitial_page()) | 415 if (tab_contents_->interstitial_page()) |
| 414 tab_contents_->interstitial_page()->SetSize(size); | 416 tab_contents_->interstitial_page()->SetSize(size); |
| 415 } | 417 } |
| OLD | NEW |