| 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/ui/views/tab_contents/tab_contents_view_views.h" | 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/ui/constrained_window.h" | 10 #include "chrome/browser/ui/constrained_window.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 294 } |
| 295 | 295 |
| 296 void TabContentsViewViews::CloseTab() { | 296 void TabContentsViewViews::CloseTab() { |
| 297 RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 297 RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
| 298 rvh->delegate()->Close(rvh); | 298 rvh->delegate()->Close(rvh); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void TabContentsViewViews::CreateNewWindow( | 301 void TabContentsViewViews::CreateNewWindow( |
| 302 int route_id, | 302 int route_id, |
| 303 const ViewHostMsg_CreateWindow_Params& params) { | 303 const ViewHostMsg_CreateWindow_Params& params) { |
| 304 delegate_view_helper_.CreateNewWindow(web_contents_, route_id, params); | 304 tab_contents_view_helper_.CreateNewWindow(web_contents_, route_id, params); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void TabContentsViewViews::CreateNewWidget( | 307 void TabContentsViewViews::CreateNewWidget( |
| 308 int route_id, WebKit::WebPopupType popup_type) { | 308 int route_id, WebKit::WebPopupType popup_type) { |
| 309 delegate_view_helper_.CreateNewWidget(web_contents_, | 309 tab_contents_view_helper_.CreateNewWidget(web_contents_, |
| 310 route_id, | 310 route_id, |
| 311 false, | 311 false, |
| 312 popup_type); | 312 popup_type); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void TabContentsViewViews::CreateNewFullscreenWidget(int route_id) { | 315 void TabContentsViewViews::CreateNewFullscreenWidget(int route_id) { |
| 316 delegate_view_helper_.CreateNewWidget(web_contents_, | 316 tab_contents_view_helper_.CreateNewWidget(web_contents_, |
| 317 route_id, | 317 route_id, |
| 318 true, | 318 true, |
| 319 WebKit::WebPopupTypeNone); | 319 WebKit::WebPopupTypeNone); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void TabContentsViewViews::ShowCreatedWindow(int route_id, | 322 void TabContentsViewViews::ShowCreatedWindow(int route_id, |
| 323 WindowOpenDisposition disposition, | 323 WindowOpenDisposition disposition, |
| 324 const gfx::Rect& initial_pos, | 324 const gfx::Rect& initial_pos, |
| 325 bool user_gesture) { | 325 bool user_gesture) { |
| 326 delegate_view_helper_.ShowCreatedWindow( | 326 tab_contents_view_helper_.ShowCreatedWindow( |
| 327 web_contents_, route_id, disposition, initial_pos, user_gesture); | 327 web_contents_, route_id, disposition, initial_pos, user_gesture); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void TabContentsViewViews::ShowCreatedWidget( | 330 void TabContentsViewViews::ShowCreatedWidget( |
| 331 int route_id, const gfx::Rect& initial_pos) { | 331 int route_id, const gfx::Rect& initial_pos) { |
| 332 delegate_view_helper_.ShowCreatedWidget(web_contents_, | 332 tab_contents_view_helper_.ShowCreatedWidget(web_contents_, |
| 333 route_id, | 333 route_id, |
| 334 false, | 334 false, |
| 335 initial_pos); | 335 initial_pos); |
| 336 } | 336 } |
| 337 | 337 |
| 338 void TabContentsViewViews::ShowCreatedFullscreenWidget(int route_id) { | 338 void TabContentsViewViews::ShowCreatedFullscreenWidget(int route_id) { |
| 339 delegate_view_helper_.ShowCreatedWidget(web_contents_, | 339 tab_contents_view_helper_.ShowCreatedWidget(web_contents_, |
| 340 route_id, | 340 route_id, |
| 341 true, | 341 true, |
| 342 gfx::Rect()); | 342 gfx::Rect()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void TabContentsViewViews::ShowContextMenu(const ContextMenuParams& params) { | 345 void TabContentsViewViews::ShowContextMenu(const ContextMenuParams& params) { |
| 346 // Allow delegates to handle the context menu operation first. | 346 // Allow delegates to handle the context menu operation first. |
| 347 if (web_contents_->GetDelegate() && | 347 if (web_contents_->GetDelegate() && |
| 348 web_contents_->GetDelegate()->HandleContextMenu(params)) { | 348 web_contents_->GetDelegate()->HandleContextMenu(params)) { |
| 349 return; | 349 return; |
| 350 } | 350 } |
| 351 | 351 |
| 352 context_menu_.reset(new RenderViewContextMenuViews(web_contents_, params)); | 352 context_menu_.reset(new RenderViewContextMenuViews(web_contents_, params)); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 web_contents_->HideContents(); | 469 web_contents_->HideContents(); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 void TabContentsViewViews::OnNativeWidgetSizeChanged( | 473 void TabContentsViewViews::OnNativeWidgetSizeChanged( |
| 474 const gfx::Size& new_size) { | 474 const gfx::Size& new_size) { |
| 475 if (overlaid_view_) | 475 if (overlaid_view_) |
| 476 overlaid_view_->SetBounds(gfx::Rect(new_size)); | 476 overlaid_view_->SetBounds(gfx::Rect(new_size)); |
| 477 views::Widget::OnNativeWidgetSizeChanged(new_size); | 477 views::Widget::OnNativeWidgetSizeChanged(new_size); |
| 478 } | 478 } |
| OLD | NEW |