Index: chrome/browser/ui/search/search_tab_helper.cc |
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc |
index b610cee66d12737eae90c302ed706a810bbaeaf9..b0768e70df66f038296f8d1fbb64e6218e1ce08b 100644 |
--- a/chrome/browser/ui/search/search_tab_helper.cc |
+++ b/chrome/browser/ui/search/search_tab_helper.cc |
@@ -55,20 +55,6 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(SearchTabHelper); |
namespace { |
-// For reporting Cacheable NTP navigations. |
-enum CacheableNTPLoad { |
- CACHEABLE_NTP_LOAD_FAILED = 0, |
- CACHEABLE_NTP_LOAD_SUCCEEDED = 1, |
- CACHEABLE_NTP_LOAD_MAX = 2 |
-}; |
- |
-void RecordCacheableNTPLoadHistogram(bool succeeded) { |
- UMA_HISTOGRAM_ENUMERATION("InstantExtended.CacheableNTPLoad", |
- succeeded ? CACHEABLE_NTP_LOAD_SUCCEEDED : |
- CACHEABLE_NTP_LOAD_FAILED, |
- CACHEABLE_NTP_LOAD_MAX); |
-} |
- |
bool IsCacheableNTP(const content::WebContents* contents) { |
const content::NavigationEntry* entry = |
contents->GetController().GetLastCommittedEntry(); |
@@ -310,12 +296,9 @@ void SearchTabHelper::DidNavigateMainFrame( |
const content::LoadCommittedDetails& details, |
const content::FrameNavigateParams& params) { |
if (IsCacheableNTP(web_contents_)) { |
- if (details.http_status_code == 204 || details.http_status_code >= 400) { |
- RedirectToLocalNTP(); |
- RecordCacheableNTPLoadHistogram(false); |
- return; |
- } |
- RecordCacheableNTPLoadHistogram(true); |
+ UMA_HISTOGRAM_ENUMERATION("InstantExtended.CacheableNTPLoad", |
+ chrome::CACHEABLE_NTP_LOAD_SUCCEEDED, |
+ chrome::CACHEABLE_NTP_LOAD_MAX); |
} |
// Always set the title on the new tab page to be the one from our UI |
@@ -337,21 +320,6 @@ void SearchTabHelper::DidNavigateMainFrame( |
} |
} |
-void SearchTabHelper::DidFailProvisionalLoad( |
- content::RenderFrameHost* render_frame_host, |
- const GURL& validated_url, |
- int error_code, |
- const base::string16& /* error_description */) { |
- // If error_code is ERR_ABORTED means that the user has canceled this |
- // navigation so it shouldn't be redirected. |
- if (!render_frame_host->GetParent() && error_code != net::ERR_ABORTED && |
- validated_url != GURL(chrome::kChromeSearchLocalNtpUrl) && |
- chrome::IsNTPURL(validated_url, profile())) { |
- RedirectToLocalNTP(); |
- RecordCacheableNTPLoadHistogram(false); |
- } |
-} |
- |
void SearchTabHelper::DidFinishLoad(content::RenderFrameHost* render_frame_host, |
const GURL& /* validated_url */) { |
if (!render_frame_host->GetParent()) { |
@@ -618,17 +586,6 @@ Profile* SearchTabHelper::profile() const { |
return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
} |
-void SearchTabHelper::RedirectToLocalNTP() { |
- // Extra parentheses to declare a variable. |
- content::NavigationController::LoadURLParams load_params( |
- (GURL(chrome::kChromeSearchLocalNtpUrl))); |
- load_params.referrer = content::Referrer(); |
- load_params.transition_type = ui::PAGE_TRANSITION_SERVER_REDIRECT; |
- // Don't push a history entry. |
- load_params.should_replace_current_entry = true; |
- web_contents_->GetController().LoadURLWithParams(load_params); |
-} |
- |
bool SearchTabHelper::IsInputInProgress() const { |
OmniboxView* omnibox = GetOmniboxView(); |
return !model_.mode().is_ntp() && omnibox && |