Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/thread.h" | 9 #include "base/thread.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 InitInterstitialPageMap(); | 119 InitInterstitialPageMap(); |
| 120 // It would be inconsistent to create an interstitial with no new navigation | 120 // It would be inconsistent to create an interstitial with no new navigation |
| 121 // (which is the case when the interstitial was triggered by a sub-resource on | 121 // (which is the case when the interstitial was triggered by a sub-resource on |
| 122 // a page) when we have a pending entry (in the process of loading a new top | 122 // a page) when we have a pending entry (in the process of loading a new top |
| 123 // frame). | 123 // frame). |
| 124 DCHECK(new_navigation || !tab->controller()->GetPendingEntry()); | 124 DCHECK(new_navigation || !tab->controller()->GetPendingEntry()); |
| 125 } | 125 } |
| 126 | 126 |
| 127 InterstitialPage::~InterstitialPage() { | 127 InterstitialPage::~InterstitialPage() { |
| 128 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_); | 128 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_); |
| 129 DCHECK(iter != tab_to_interstitial_page_->end()); | 129 DCHECK(iter != tab_to_interstitial_page_->end()) << |
| 130 tab_to_interstitial_page_->erase(iter); | 130 "InterstitialPage missing from map. Please add a comment to the bug " |
| 131 "http://crbug.com/9442 with the URL you were visiting"; | |
| 132 if (iter != tab_to_interstitial_page_->end()) | |
| 133 tab_to_interstitial_page_->erase(iter); | |
|
Paul Godavari
2009/03/28 01:34:54
LGTM.
Could this be due to multiple malware resou
jcampan
2009/03/28 01:42:22
Shouldn't be the case anymore. I added some code f
| |
| 131 DCHECK(!render_view_host_); | 134 DCHECK(!render_view_host_); |
| 132 } | 135 } |
| 133 | 136 |
| 134 void InterstitialPage::Show() { | 137 void InterstitialPage::Show() { |
| 135 // If an interstitial is already showing, close it before showing the new one. | 138 // If an interstitial is already showing, close it before showing the new one. |
| 136 if (tab_->interstitial_page()) | 139 if (tab_->interstitial_page()) |
| 137 tab_->interstitial_page()->DontProceed(); | 140 tab_->interstitial_page()->DontProceed(); |
| 138 | 141 |
| 139 // Block the resource requests for the render view host while it is hidden. | 142 // Block the resource requests for the render view host while it is hidden. |
| 140 TakeActionOnResourceDispatcher(BLOCK); | 143 TakeActionOnResourceDispatcher(BLOCK); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent( | 485 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent( |
| 483 const NativeWebKeyboardEvent& event) { | 486 const NativeWebKeyboardEvent& event) { |
| 484 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) | 487 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) |
| 485 interstitial_page_->tab()->GetViewDelegate()->HandleKeyboardEvent(event); | 488 interstitial_page_->tab()->GetViewDelegate()->HandleKeyboardEvent(event); |
| 486 } | 489 } |
| 487 | 490 |
| 488 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 491 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
| 489 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 492 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
| 490 int active_match_ordinal, bool final_update) { | 493 int active_match_ordinal, bool final_update) { |
| 491 } | 494 } |
| OLD | NEW |