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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 void InterstitialPage::FocusThroughTabTraversal(bool reverse) { | 520 void InterstitialPage::FocusThroughTabTraversal(bool reverse) { |
521 render_view_host_->SetInitialFocus(reverse); | 521 render_view_host_->SetInitialFocus(reverse); |
522 } | 522 } |
523 | 523 |
524 void InterstitialPage::Disable() { | 524 void InterstitialPage::Disable() { |
525 enabled_ = false; | 525 enabled_ = false; |
526 } | 526 } |
527 | 527 |
528 void InterstitialPage::TakeActionOnResourceDispatcher( | 528 void InterstitialPage::TakeActionOnResourceDispatcher( |
529 ResourceRequestAction action) { | 529 ResourceRequestAction action) { |
530 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)) << | 530 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)) << |
531 "TakeActionOnResourceDispatcher should be called on the main thread."; | 531 "TakeActionOnResourceDispatcher should be called on the main thread."; |
532 | 532 |
533 if (action == CANCEL || action == RESUME) { | 533 if (action == CANCEL || action == RESUME) { |
534 if (resource_dispatcher_host_notified_) | 534 if (resource_dispatcher_host_notified_) |
535 return; | 535 return; |
536 resource_dispatcher_host_notified_ = true; | 536 resource_dispatcher_host_notified_ = true; |
537 } | 537 } |
538 | 538 |
539 // The tab might not have a render_view_host if it was closed (in which case, | 539 // The tab might not have a render_view_host if it was closed (in which case, |
540 // we have taken care of the blocked requests when processing | 540 // we have taken care of the blocked requests when processing |
541 // NOTIFY_RENDER_WIDGET_HOST_DESTROYED. | 541 // NOTIFY_RENDER_WIDGET_HOST_DESTROYED. |
542 // Also we need to test there is a ResourceDispatcherHost, as when unit-tests | 542 // Also we need to test there is a ResourceDispatcherHost, as when unit-tests |
543 // we don't have one. | 543 // we don't have one. |
544 RenderViewHost* rvh = RenderViewHost::FromID(original_child_id_, | 544 RenderViewHost* rvh = RenderViewHost::FromID(original_child_id_, |
545 original_rvh_id_); | 545 original_rvh_id_); |
546 if (!rvh || !g_browser_process->resource_dispatcher_host()) | 546 if (!rvh || !g_browser_process->resource_dispatcher_host()) |
547 return; | 547 return; |
548 | 548 |
549 ChromeThread::PostTask( | 549 BrowserThread::PostTask( |
550 ChromeThread::IO, FROM_HERE, | 550 BrowserThread::IO, FROM_HERE, |
551 new ResourceRequestTask(original_child_id_, original_rvh_id_, action)); | 551 new ResourceRequestTask(original_child_id_, original_rvh_id_, action)); |
552 } | 552 } |
553 | 553 |
554 // static | 554 // static |
555 void InterstitialPage::InitInterstitialPageMap() { | 555 void InterstitialPage::InitInterstitialPageMap() { |
556 if (!tab_to_interstitial_page_) | 556 if (!tab_to_interstitial_page_) |
557 tab_to_interstitial_page_ = new InterstitialPageMap; | 557 tab_to_interstitial_page_ = new InterstitialPageMap; |
558 } | 558 } |
559 | 559 |
560 // static | 560 // static |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 } | 690 } |
691 | 691 |
692 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 692 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
693 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 693 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
694 int active_match_ordinal, bool final_update) { | 694 int active_match_ordinal, bool final_update) { |
695 } | 695 } |
696 | 696 |
697 int InterstitialPage::GetBrowserWindowID() const { | 697 int InterstitialPage::GetBrowserWindowID() const { |
698 return tab_->GetBrowserWindowID(); | 698 return tab_->GetBrowserWindowID(); |
699 } | 699 } |
OLD | NEW |