diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 19:52:40 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 19:52:40 +0000 |
commit | 1ef5ad42064c8ef0d1503b68a7fbac01887ca093 (patch) | |
tree | 34a32b11a9db6f69fef27e7e81863d82a29bcd2d /chrome/browser/safe_browsing | |
parent | 59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919 (diff) | |
download | chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.zip chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.gz chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.bz2 |
Reverting 14005.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
3 files changed, 21 insertions, 19 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index fd07b9d6..0c1e95e 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -85,7 +85,7 @@ SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( unsafe_resources_(unsafe_resources) { if (!is_main_frame_) { navigation_entry_index_to_remove_ = - tab()->controller().last_committed_entry_index(); + tab()->controller()->last_committed_entry_index(); } else { navigation_entry_index_to_remove_ = -1; } @@ -402,8 +402,8 @@ void SafeBrowsingBlockingPage::DontProceed() { // would trigger a navigation that would cause trouble as the render view host // for the tab has by then already been destroyed. if (navigation_entry_index_to_remove_ != -1 && !tab()->is_being_destroyed()) { - tab()->controller().RemoveEntryAtIndex(navigation_entry_index_to_remove_, - GURL(chrome::kChromeUINewTabURL)); + tab()->controller()->RemoveEntryAtIndex(navigation_entry_index_to_remove_, + GURL(chrome::kChromeUINewTabURL)); navigation_entry_index_to_remove_ = -1; } InterstitialPage::DontProceed(); diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index 32f3ab6..e8311db 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc @@ -154,7 +154,7 @@ class SafeBrowsingBlockingPageTest : public RenderViewHostTestHarness, // Tests showing a blocking page for a malware page and not proceeding. TEST_F(SafeBrowsingBlockingPageTest, MalwarePageDontProceed) { // Start a load. - controller().LoadURL(GURL(kBadURL), GURL(), PageTransition::TYPED); + controller()->LoadURL(GURL(kBadURL), GURL(), PageTransition::TYPED); // Simulate the load causing a safe browsing interstitial to be shown. ShowInterstitial(ResourceType::MAIN_FRAME, kBadURL); @@ -169,13 +169,13 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwarePageDontProceed) { EXPECT_FALSE(GetSafeBrowsingBlockingPage()); // We did not proceed, the pending entry should be gone. - EXPECT_FALSE(controller().pending_entry()); + EXPECT_FALSE(controller()->pending_entry()); } // Tests showing a blocking page for a malware page and then proceeding. TEST_F(SafeBrowsingBlockingPageTest, MalwarePageProceed) { // Start a load. - controller().LoadURL(GURL(kBadURL), GURL(), PageTransition::TYPED); + controller()->LoadURL(GURL(kBadURL), GURL(), PageTransition::TYPED); // Simulate the load causing a safe browsing interstitial to be shown. ShowInterstitial(ResourceType::MAIN_FRAME, kBadURL); @@ -215,8 +215,8 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceDontProceed) { // We did not proceed, we should be back to the first page, the 2nd one should // have been removed from the navigation controller. - ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->url().spec()); + ASSERT_EQ(1, controller()->entry_count()); + EXPECT_EQ(kGoogleURL, controller()->GetActiveEntry()->url().spec()); } // Tests showing a blocking page for a page that contains malware subresources @@ -237,8 +237,8 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceProceed) { EXPECT_FALSE(GetSafeBrowsingBlockingPage()); // We did proceed, we should be back to showing the page. - ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->url().spec()); + ASSERT_EQ(1, controller()->entry_count()); + EXPECT_EQ(kGoodURL, controller()->GetActiveEntry()->url().spec()); } // Tests showing a blocking page for a page that contains multiple malware @@ -270,8 +270,8 @@ TEST_F(SafeBrowsingBlockingPageTest, // We did not proceed, we should be back to the first page, the 2nd one should // have been removed from the navigation controller. - ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->url().spec()); + ASSERT_EQ(1, controller()->entry_count()); + EXPECT_EQ(kGoogleURL, controller()->GetActiveEntry()->url().spec()); } // Tests showing a blocking page for a page that contains multiple malware @@ -313,8 +313,8 @@ TEST_F(SafeBrowsingBlockingPageTest, // We did not proceed, we should be back to the first page, the 2nd one should // have been removed from the navigation controller. - ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->url().spec()); + ASSERT_EQ(1, controller()->entry_count()); + EXPECT_EQ(kGoogleURL, controller()->GetActiveEntry()->url().spec()); } // Tests showing a blocking page for a page that contains multiple malware @@ -350,6 +350,6 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMultipleMalwareResourceProceed) { EXPECT_EQ(OK, user_response()); // We did proceed, we should be back to the initial page. - ASSERT_EQ(1, controller().entry_count()); - EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->url().spec()); + ASSERT_EQ(1, controller()->entry_count()); + EXPECT_EQ(kGoodURL, controller()->GetActiveEntry()->url().spec()); } diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 6369b3d..1a1c88a3 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -285,9 +285,11 @@ void SafeBrowsingService::DoDisplayBlockingPage( resource.threat_type == SafeBrowsingService::URL_MALWARE) { GURL page_url = wc->GetURL(); GURL referrer_url; - NavigationEntry* entry = wc->controller().GetActiveEntry(); - if (entry) - referrer_url = entry->referrer(); + if (wc->controller()) { + NavigationEntry* entry = wc->controller()->GetActiveEntry(); + if (entry) + referrer_url = entry->referrer(); + } io_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, &SafeBrowsingService::ReportMalware, |