| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/net/predictor_tab_helper.h" | 5 #include "chrome/browser/net/predictor_tab_helper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/net/predictor.h" | 8 #include "chrome/browser/net/predictor.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace chrome_browser_net { | 35 namespace chrome_browser_net { |
| 36 | 36 |
| 37 PredictorTabHelper::PredictorTabHelper(content::WebContents* web_contents) | 37 PredictorTabHelper::PredictorTabHelper(content::WebContents* web_contents) |
| 38 : content::WebContentsObserver(web_contents) { | 38 : content::WebContentsObserver(web_contents) { |
| 39 } | 39 } |
| 40 | 40 |
| 41 PredictorTabHelper::~PredictorTabHelper() { | 41 PredictorTabHelper::~PredictorTabHelper() { |
| 42 } | 42 } |
| 43 | 43 |
| 44 void PredictorTabHelper::NavigateToPendingEntry( | 44 void PredictorTabHelper::DidCreatePendingEntry( |
| 45 const GURL& url, | 45 const GURL& url, |
| 46 content::NavigationController::ReloadType reload_type) { | 46 content::NavigationController::ReloadType reload_type) { |
| 47 Profile* profile = | 47 Profile* profile = |
| 48 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 48 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 49 chrome_browser_net::Predictor* predictor = profile->GetNetworkPredictor(); | 49 chrome_browser_net::Predictor* predictor = profile->GetNetworkPredictor(); |
| 50 if (!predictor) | 50 if (!predictor) |
| 51 return; | 51 return; |
| 52 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame) && | 52 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame) && |
| 53 (url.SchemeIs(content::kHttpScheme) || | 53 (url.SchemeIs(content::kHttpScheme) || |
| 54 url.SchemeIs(content::kHttpsScheme))) | 54 url.SchemeIs(content::kHttpsScheme))) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 69 BrowserThread::PostTask( | 69 BrowserThread::PostTask( |
| 70 BrowserThread::IO, | 70 BrowserThread::IO, |
| 71 FROM_HERE, | 71 FROM_HERE, |
| 72 base::Bind(&Predictor::RecordLinkNavigation, | 72 base::Bind(&Predictor::RecordLinkNavigation, |
| 73 base::Unretained(predictor), | 73 base::Unretained(predictor), |
| 74 params.url)); | 74 params.url)); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace chrome_browser_net | 78 } // namespace chrome_browser_net |
| OLD | NEW |