| 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 "content/browser/tab_contents/interstitial_page.h" | 5 #include "content/browser/tab_contents/interstitial_page.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } // namespace | 64 } // namespace |
| 65 | 65 |
| 66 class InterstitialPage::InterstitialPageRVHViewDelegate | 66 class InterstitialPage::InterstitialPageRVHViewDelegate |
| 67 : public RenderViewHostDelegate::View { | 67 : public RenderViewHostDelegate::View { |
| 68 public: | 68 public: |
| 69 explicit InterstitialPageRVHViewDelegate(InterstitialPage* page); | 69 explicit InterstitialPageRVHViewDelegate(InterstitialPage* page); |
| 70 | 70 |
| 71 // RenderViewHostDelegate::View implementation: | 71 // RenderViewHostDelegate::View implementation: |
| 72 virtual void CreateNewWindow( | 72 virtual void CreateNewWindow( |
| 73 int route_id, | 73 int route_id, |
| 74 const ViewHostMsg_CreateWindow_Params& params); | 74 const ViewHostMsg_CreateWindow_Params& params, |
| 75 content::ContentFrame* opener); |
| 75 virtual void CreateNewWidget(int route_id, | 76 virtual void CreateNewWidget(int route_id, |
| 76 WebKit::WebPopupType popup_type); | 77 WebKit::WebPopupType popup_type); |
| 77 virtual void CreateNewFullscreenWidget(int route_id); | 78 virtual void CreateNewFullscreenWidget(int route_id); |
| 78 virtual void ShowCreatedWindow(int route_id, | 79 virtual void ShowCreatedWindow(int route_id, |
| 79 WindowOpenDisposition disposition, | 80 WindowOpenDisposition disposition, |
| 80 const gfx::Rect& initial_pos, | 81 const gfx::Rect& initial_pos, |
| 81 bool user_gesture); | 82 bool user_gesture); |
| 82 virtual void ShowCreatedWidget(int route_id, | 83 virtual void ShowCreatedWidget(int route_id, |
| 83 const gfx::Rect& initial_pos); | 84 const gfx::Rect& initial_pos); |
| 84 virtual void ShowCreatedFullscreenWidget(int route_id); | 85 virtual void ShowCreatedFullscreenWidget(int route_id); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 408 |
| 408 TabContentsView* InterstitialPage::CreateTabContentsView() { | 409 TabContentsView* InterstitialPage::CreateTabContentsView() { |
| 409 TabContentsView* tab_contents_view = tab()->view(); | 410 TabContentsView* tab_contents_view = tab()->view(); |
| 410 RenderWidgetHostView* view = | 411 RenderWidgetHostView* view = |
| 411 tab_contents_view->CreateViewForWidget(render_view_host_); | 412 tab_contents_view->CreateViewForWidget(render_view_host_); |
| 412 render_view_host_->SetView(view); | 413 render_view_host_->SetView(view); |
| 413 render_view_host_->AllowBindings(content::BINDINGS_POLICY_DOM_AUTOMATION); | 414 render_view_host_->AllowBindings(content::BINDINGS_POLICY_DOM_AUTOMATION); |
| 414 | 415 |
| 415 int32 max_page_id = | 416 int32 max_page_id = |
| 416 tab()->GetMaxPageIDForSiteInstance(render_view_host_->site_instance()); | 417 tab()->GetMaxPageIDForSiteInstance(render_view_host_->site_instance()); |
| 417 render_view_host_->CreateRenderView(string16(), max_page_id); | 418 render_view_host_->CreateRenderView(string16(), MSG_ROUTING_NONE, |
| 419 max_page_id); |
| 418 view->SetSize(tab_contents_view->GetContainerSize()); | 420 view->SetSize(tab_contents_view->GetContainerSize()); |
| 419 // Don't show the interstitial until we have navigated to it. | 421 // Don't show the interstitial until we have navigated to it. |
| 420 view->Hide(); | 422 view->Hide(); |
| 421 return tab_contents_view; | 423 return tab_contents_view; |
| 422 } | 424 } |
| 423 | 425 |
| 424 void InterstitialPage::Proceed() { | 426 void InterstitialPage::Proceed() { |
| 425 if (action_taken_ != NO_ACTION) { | 427 if (action_taken_ != NO_ACTION) { |
| 426 NOTREACHED(); | 428 NOTREACHED(); |
| 427 return; | 429 return; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 return iter->second; | 582 return iter->second; |
| 581 } | 583 } |
| 582 | 584 |
| 583 InterstitialPage::InterstitialPageRVHViewDelegate:: | 585 InterstitialPage::InterstitialPageRVHViewDelegate:: |
| 584 InterstitialPageRVHViewDelegate(InterstitialPage* page) | 586 InterstitialPageRVHViewDelegate(InterstitialPage* page) |
| 585 : interstitial_page_(page) { | 587 : interstitial_page_(page) { |
| 586 } | 588 } |
| 587 | 589 |
| 588 void InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewWindow( | 590 void InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewWindow( |
| 589 int route_id, | 591 int route_id, |
| 590 const ViewHostMsg_CreateWindow_Params& params) { | 592 const ViewHostMsg_CreateWindow_Params& params, |
| 593 content::ContentFrame* opener) { |
| 591 NOTREACHED() << "InterstitialPage does not support showing popups yet."; | 594 NOTREACHED() << "InterstitialPage does not support showing popups yet."; |
| 592 } | 595 } |
| 593 | 596 |
| 594 void InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewWidget( | 597 void InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewWidget( |
| 595 int route_id, WebKit::WebPopupType popup_type) { | 598 int route_id, WebKit::WebPopupType popup_type) { |
| 596 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; | 599 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; |
| 597 } | 600 } |
| 598 | 601 |
| 599 void | 602 void |
| 600 InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewFullscreenWidget( | 603 InterstitialPage::InterstitialPageRVHViewDelegate::CreateNewFullscreenWidget( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus( | 656 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus( |
| 654 bool reverse) { | 657 bool reverse) { |
| 655 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) | 658 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) |
| 656 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse); | 659 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse); |
| 657 } | 660 } |
| 658 | 661 |
| 659 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 662 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
| 660 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 663 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
| 661 int active_match_ordinal, bool final_update) { | 664 int active_match_ordinal, bool final_update) { |
| 662 } | 665 } |
| OLD | NEW |