Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: chrome/browser/net/predictor_tab_helper.cc

Issue 23064011: Consolidate scheme checks into an easy GURL method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/net/predictor.cc ('k') | chrome/browser/prerender/prerender_histograms.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/net/predictor.h" 7 #include "chrome/browser/net/predictor.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/common/frame_navigate_params.h" 10 #include "content/public/common/frame_navigate_params.h"
(...skipping 24 matching lines...) Expand all
35 : content::WebContentsObserver(web_contents) { 35 : content::WebContentsObserver(web_contents) {
36 } 36 }
37 37
38 PredictorTabHelper::~PredictorTabHelper() { 38 PredictorTabHelper::~PredictorTabHelper() {
39 } 39 }
40 40
41 void PredictorTabHelper::DidNavigateMainFrame( 41 void PredictorTabHelper::DidNavigateMainFrame(
42 const content::LoadCommittedDetails& details, 42 const content::LoadCommittedDetails& details,
43 const content::FrameNavigateParams& params) { 43 const content::FrameNavigateParams& params) {
44 if (!IsUserLinkNavigationRequest(params.transition) || 44 if (!IsUserLinkNavigationRequest(params.transition) ||
45 !(params.url.SchemeIs("http") || params.url.SchemeIs("https"))) 45 !(params.url.SchemeIsHTTPOrHTTPS()))
46 return; 46 return;
47 47
48 Profile* profile = Profile::FromBrowserContext( 48 Profile* profile = Profile::FromBrowserContext(
49 web_contents()->GetBrowserContext()); 49 web_contents()->GetBrowserContext());
50 Predictor* predictor = profile->GetNetworkPredictor(); 50 Predictor* predictor = profile->GetNetworkPredictor();
51 if (predictor) { 51 if (predictor) {
52 BrowserThread::PostTask( 52 BrowserThread::PostTask(
53 BrowserThread::IO, 53 BrowserThread::IO,
54 FROM_HERE, 54 FROM_HERE,
55 base::Bind(&Predictor::RecordLinkNavigation, 55 base::Bind(&Predictor::RecordLinkNavigation,
56 base::Unretained(predictor), 56 base::Unretained(predictor),
57 params.url)); 57 params.url));
58 } 58 }
59 } 59 }
60 60
61 } // namespace chrome_browser_net 61 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/predictor.cc ('k') | chrome/browser/prerender/prerender_histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698