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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 resource_dispatcher_host_notified_ = true; | 566 resource_dispatcher_host_notified_ = true; |
567 } | 567 } |
568 | 568 |
569 // The tab might not have a render_view_host if it was closed (in which case, | 569 // The tab might not have a render_view_host if it was closed (in which case, |
570 // we have taken care of the blocked requests when processing | 570 // we have taken care of the blocked requests when processing |
571 // NOTIFY_RENDER_WIDGET_HOST_DESTROYED. | 571 // NOTIFY_RENDER_WIDGET_HOST_DESTROYED. |
572 // Also we need to test there is a ResourceDispatcherHost, as when unit-tests | 572 // Also we need to test there is a ResourceDispatcherHost, as when unit-tests |
573 // we don't have one. | 573 // we don't have one. |
574 RenderViewHost* rvh = RenderViewHost::FromID(original_child_id_, | 574 RenderViewHost* rvh = RenderViewHost::FromID(original_child_id_, |
575 original_rvh_id_); | 575 original_rvh_id_); |
576 if (!rvh || | 576 if (!rvh || !ResourceDispatcherHost::Get()) |
577 !content::GetContentClient()->browser()->GetResourceDispatcherHost()) { | |
578 return; | 577 return; |
579 } | |
580 | 578 |
581 BrowserThread::PostTask( | 579 BrowserThread::PostTask( |
582 BrowserThread::IO, | 580 BrowserThread::IO, |
583 FROM_HERE, | 581 FROM_HERE, |
584 base::Bind( | 582 base::Bind( |
585 &ResourceRequestHelper, | 583 &ResourceRequestHelper, |
586 content::GetContentClient()->browser()->GetResourceDispatcherHost(), | 584 ResourceDispatcherHost::Get(), |
587 original_child_id_, | 585 original_child_id_, |
588 original_rvh_id_, | 586 original_rvh_id_, |
589 action)); | 587 action)); |
590 } | 588 } |
591 | 589 |
592 // static | 590 // static |
593 void InterstitialPage::InitInterstitialPageMap() { | 591 void InterstitialPage::InitInterstitialPageMap() { |
594 if (!tab_to_interstitial_page_) | 592 if (!tab_to_interstitial_page_) |
595 tab_to_interstitial_page_ = new InterstitialPageMap; | 593 tab_to_interstitial_page_ = new InterstitialPageMap; |
596 } | 594 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 if (!tab->GetViewDelegate()) | 684 if (!tab->GetViewDelegate()) |
687 return; | 685 return; |
688 | 686 |
689 tab->GetViewDelegate()->TakeFocus(reverse); | 687 tab->GetViewDelegate()->TakeFocus(reverse); |
690 } | 688 } |
691 | 689 |
692 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 690 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
693 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 691 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
694 int active_match_ordinal, bool final_update) { | 692 int active_match_ordinal, bool final_update) { |
695 } | 693 } |
OLD | NEW |