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

Side by Side Diff: chrome/browser/search/search.cc

Issue 2478573004: Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==. (Closed)
Patch Set: rebase to #431874 Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/search/search.h" 5 #include "chrome/browser/search/search.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 const InstantService* instant_service = 284 const InstantService* instant_service =
285 InstantServiceFactory::GetForProfile(profile); 285 InstantServiceFactory::GetForProfile(profile);
286 if (!instant_service) 286 if (!instant_service)
287 return false; 287 return false;
288 288
289 return instant_service->IsInstantProcess(process_host->GetID()); 289 return instant_service->IsInstantProcess(process_host->GetID());
290 } 290 }
291 291
292 bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) { 292 bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) {
293 return ShouldAssignURLToInstantRenderer(url, profile) && 293 return ShouldAssignURLToInstantRenderer(url, profile) &&
294 (url.host() == chrome::kChromeSearchLocalNtpHost || 294 (url.host_piece() == chrome::kChromeSearchLocalNtpHost ||
295 url.host() == chrome::kChromeSearchRemoteNtpHost); 295 url.host_piece() == chrome::kChromeSearchRemoteNtpHost);
296 } 296 }
297 297
298 bool IsNTPURL(const GURL& url, Profile* profile) { 298 bool IsNTPURL(const GURL& url, Profile* profile) {
299 if (!url.is_valid()) 299 if (!url.is_valid())
300 return false; 300 return false;
301 301
302 if (!IsInstantExtendedAPIEnabled()) 302 if (!IsInstantExtendedAPIEnabled())
303 return url == chrome::kChromeUINewTabURL; 303 return url == chrome::kChromeUINewTabURL;
304 304
305 const base::string16 search_terms = ExtractSearchTermsFromURL(profile, url); 305 const base::string16 search_terms = ExtractSearchTermsFromURL(profile, url);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 if (IsInstantNTPURL(*url, profile)) { 456 if (IsInstantNTPURL(*url, profile)) {
457 *url = GURL(chrome::kChromeUINewTabURL); 457 *url = GURL(chrome::kChromeUINewTabURL);
458 return true; 458 return true;
459 } 459 }
460 460
461 return false; 461 return false;
462 } 462 }
463 463
464 } // namespace search 464 } // namespace search
OLDNEW
« no previous file with comments | « chrome/browser/search/local_ntp_source.cc ('k') | chrome/browser/sessions/session_common_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698