| 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 "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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 gtk_widget_grab_focus(widget); | 327 gtk_widget_grab_focus(widget); |
| 328 bool reverse = focus == GTK_DIR_TAB_BACKWARD; | 328 bool reverse = focus == GTK_DIR_TAB_BACKWARD; |
| 329 tab_contents_->FocusThroughTabTraversal(reverse); | 329 tab_contents_->FocusThroughTabTraversal(reverse); |
| 330 return TRUE; | 330 return TRUE; |
| 331 } | 331 } |
| 332 | 332 |
| 333 void TabContentsViewGtk::CreateNewWindow( | 333 void TabContentsViewGtk::CreateNewWindow( |
| 334 int route_id, | 334 int route_id, |
| 335 const ViewHostMsg_CreateWindow_Params& params) { | 335 const ViewHostMsg_CreateWindow_Params& params) { |
| 336 delegate_view_helper_.CreateNewWindow(tab_contents_, route_id, params); | 336 tab_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void TabContentsViewGtk::CreateNewWidget( | 339 void TabContentsViewGtk::CreateNewWidget( |
| 340 int route_id, WebKit::WebPopupType popup_type) { | 340 int route_id, WebKit::WebPopupType popup_type) { |
| 341 delegate_view_helper_.CreateNewWidget(tab_contents_, | 341 tab_contents_view_helper_.CreateNewWidget(tab_contents_, |
| 342 route_id, | 342 route_id, |
| 343 false, | 343 false, |
| 344 popup_type); | 344 popup_type); |
| 345 } | 345 } |
| 346 | 346 |
| 347 void TabContentsViewGtk::CreateNewFullscreenWidget(int route_id) { | 347 void TabContentsViewGtk::CreateNewFullscreenWidget(int route_id) { |
| 348 delegate_view_helper_.CreateNewWidget(tab_contents_, | 348 tab_contents_view_helper_.CreateNewWidget(tab_contents_, |
| 349 route_id, | 349 route_id, |
| 350 true, | 350 true, |
| 351 WebKit::WebPopupTypeNone); | 351 WebKit::WebPopupTypeNone); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void TabContentsViewGtk::ShowCreatedWindow(int route_id, | 354 void TabContentsViewGtk::ShowCreatedWindow(int route_id, |
| 355 WindowOpenDisposition disposition, | 355 WindowOpenDisposition disposition, |
| 356 const gfx::Rect& initial_pos, | 356 const gfx::Rect& initial_pos, |
| 357 bool user_gesture) { | 357 bool user_gesture) { |
| 358 delegate_view_helper_.ShowCreatedWindow( | 358 tab_contents_view_helper_.ShowCreatedWindow( |
| 359 tab_contents_, route_id, disposition, initial_pos, user_gesture); | 359 tab_contents_, route_id, disposition, initial_pos, user_gesture); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void TabContentsViewGtk::ShowCreatedWidget( | 362 void TabContentsViewGtk::ShowCreatedWidget( |
| 363 int route_id, const gfx::Rect& initial_pos) { | 363 int route_id, const gfx::Rect& initial_pos) { |
| 364 delegate_view_helper_.ShowCreatedWidget(tab_contents_, | 364 tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, |
| 365 route_id, | 365 route_id, |
| 366 false, | 366 false, |
| 367 initial_pos); | 367 initial_pos); |
| 368 } | 368 } |
| 369 | 369 |
| 370 void TabContentsViewGtk::ShowCreatedFullscreenWidget(int route_id) { | 370 void TabContentsViewGtk::ShowCreatedFullscreenWidget(int route_id) { |
| 371 delegate_view_helper_.ShowCreatedWidget(tab_contents_, | 371 tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, |
| 372 route_id, | 372 route_id, |
| 373 true, | 373 true, |
| 374 gfx::Rect()); | 374 gfx::Rect()); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) { | 377 void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) { |
| 378 if (wrapper()) | 378 if (wrapper()) |
| 379 wrapper()->ShowContextMenu(params); | 379 wrapper()->ShowContextMenu(params); |
| 380 else | 380 else |
| 381 DLOG(ERROR) << "Implement context menus without chrome/ code"; | 381 DLOG(ERROR) << "Implement context menus without chrome/ code"; |
| 382 } | 382 } |
| 383 | 383 |
| 384 void TabContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, | 384 void TabContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 requested_size_ = size; | 431 requested_size_ = size; |
| 432 | 432 |
| 433 // We manually tell our RWHV to resize the renderer content. This avoids | 433 // We manually tell our RWHV to resize the renderer content. This avoids |
| 434 // spurious resizes from GTK+. | 434 // spurious resizes from GTK+. |
| 435 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); | 435 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); |
| 436 if (rwhv) | 436 if (rwhv) |
| 437 rwhv->SetSize(size); | 437 rwhv->SetSize(size); |
| 438 if (tab_contents_->GetInterstitialPage()) | 438 if (tab_contents_->GetInterstitialPage()) |
| 439 tab_contents_->GetInterstitialPage()->SetSize(size); | 439 tab_contents_->GetInterstitialPage()->SetSize(size); |
| 440 } | 440 } |
| OLD | NEW |