OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/interstitial_page.h" | 5 #include "chrome/browser/tab_contents/interstitial_page.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/thread.h" | 10 #include "base/thread.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 return render_view_host; | 397 return render_view_host; |
398 } | 398 } |
399 | 399 |
400 TabContentsView* InterstitialPage::CreateTabContentsView() { | 400 TabContentsView* InterstitialPage::CreateTabContentsView() { |
401 TabContentsView* tab_contents_view = tab()->view(); | 401 TabContentsView* tab_contents_view = tab()->view(); |
402 RenderWidgetHostView* view = | 402 RenderWidgetHostView* view = |
403 tab_contents_view->CreateViewForWidget(render_view_host_); | 403 tab_contents_view->CreateViewForWidget(render_view_host_); |
404 render_view_host_->set_view(view); | 404 render_view_host_->set_view(view); |
405 render_view_host_->AllowBindings(BindingsPolicy::DOM_AUTOMATION); | 405 render_view_host_->AllowBindings(BindingsPolicy::DOM_AUTOMATION); |
406 | 406 |
407 scoped_refptr<URLRequestContextGetter> request_context = | 407 render_view_host_->CreateRenderView(string16()); |
408 tab()->request_context(); | |
409 if (!request_context.get()) | |
410 request_context = tab()->profile()->GetRequestContext(); | |
411 | |
412 render_view_host_->CreateRenderView(request_context.get(), string16()); | |
413 view->SetSize(tab_contents_view->GetContainerSize()); | 408 view->SetSize(tab_contents_view->GetContainerSize()); |
414 // Don't show the interstitial until we have navigated to it. | 409 // Don't show the interstitial until we have navigated to it. |
415 view->Hide(); | 410 view->Hide(); |
416 return tab_contents_view; | 411 return tab_contents_view; |
417 } | 412 } |
418 | 413 |
419 void InterstitialPage::Proceed() { | 414 void InterstitialPage::Proceed() { |
420 if (action_taken_ != NO_ACTION) { | 415 if (action_taken_ != NO_ACTION) { |
421 NOTREACHED(); | 416 NOTREACHED(); |
422 return; | 417 return; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 } | 633 } |
639 | 634 |
640 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 635 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
641 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 636 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
642 int active_match_ordinal, bool final_update) { | 637 int active_match_ordinal, bool final_update) { |
643 } | 638 } |
644 | 639 |
645 int InterstitialPage::GetBrowserWindowID() const { | 640 int InterstitialPage::GetBrowserWindowID() const { |
646 return tab_->GetBrowserWindowID(); | 641 return tab_->GetBrowserWindowID(); |
647 } | 642 } |
OLD | NEW |