| 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 // Implementation of the SafeBrowsingBlockingPage class. | 5 // Implementation of the SafeBrowsingBlockingPage class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 if (iter != unsafe_resource_map->end() && !iter->second.empty()) { | 370 if (iter != unsafe_resource_map->end() && !iter->second.empty()) { |
| 371 NotifySafeBrowsingService(sb_service_, iter->second, false); | 371 NotifySafeBrowsingService(sb_service_, iter->second, false); |
| 372 unsafe_resource_map->erase(iter); | 372 unsafe_resource_map->erase(iter); |
| 373 } | 373 } |
| 374 | 374 |
| 375 // We don't remove the navigation entry if the tab is being destroyed as this | 375 // We don't remove the navigation entry if the tab is being destroyed as this |
| 376 // would trigger a navigation that would cause trouble as the render view host | 376 // would trigger a navigation that would cause trouble as the render view host |
| 377 // for the tab has by then already been destroyed. | 377 // for the tab has by then already been destroyed. |
| 378 if (navigation_entry_index_to_remove_ != -1 && !tab()->is_being_destroyed()) { | 378 if (navigation_entry_index_to_remove_ != -1 && !tab()->is_being_destroyed()) { |
| 379 tab()->controller()->RemoveEntryAtIndex(navigation_entry_index_to_remove_, | 379 tab()->controller()->RemoveEntryAtIndex(navigation_entry_index_to_remove_, |
| 380 NewTabUIURL()); | 380 NewTabUI::GetBaseURL()); |
| 381 navigation_entry_index_to_remove_ = -1; | 381 navigation_entry_index_to_remove_ = -1; |
| 382 } | 382 } |
| 383 InterstitialPage::DontProceed(); | 383 InterstitialPage::DontProceed(); |
| 384 // We are now deleted. | 384 // We are now deleted. |
| 385 } | 385 } |
| 386 | 386 |
| 387 // static | 387 // static |
| 388 void SafeBrowsingBlockingPage::NotifySafeBrowsingService( | 388 void SafeBrowsingBlockingPage::NotifySafeBrowsingService( |
| 389 SafeBrowsingService* sb_service, | 389 SafeBrowsingService* sb_service, |
| 390 const UnsafeResourceList& unsafe_resources, | 390 const UnsafeResourceList& unsafe_resources, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 (*unsafe_resource_map)[web_contents].push_back(unsafe_resource); | 429 (*unsafe_resource_map)[web_contents].push_back(unsafe_resource); |
| 430 } | 430 } |
| 431 | 431 |
| 432 // static | 432 // static |
| 433 bool SafeBrowsingBlockingPage::IsMainPage( | 433 bool SafeBrowsingBlockingPage::IsMainPage( |
| 434 const UnsafeResourceList& unsafe_resources) { | 434 const UnsafeResourceList& unsafe_resources) { |
| 435 return unsafe_resources.size() == 1 && | 435 return unsafe_resources.size() == 1 && |
| 436 unsafe_resources[0].resource_type == ResourceType::MAIN_FRAME; | 436 unsafe_resources[0].resource_type == ResourceType::MAIN_FRAME; |
| 437 } | 437 } |
| 438 | 438 |
| OLD | NEW |