| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |