| 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/search/instant_service.h" | 5 #include "chrome/browser/search/instant_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #if !defined(OS_ANDROID) | 53 #if !defined(OS_ANDROID) |
| 54 #include "chrome/browser/search/local_ntp_source.h" | 54 #include "chrome/browser/search/local_ntp_source.h" |
| 55 #include "chrome/browser/themes/theme_properties.h" | 55 #include "chrome/browser/themes/theme_properties.h" |
| 56 #include "chrome/browser/themes/theme_service.h" | 56 #include "chrome/browser/themes/theme_service.h" |
| 57 #include "chrome/browser/themes/theme_service_factory.h" | 57 #include "chrome/browser/themes/theme_service_factory.h" |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 namespace { | 60 namespace { |
| 61 | 61 |
| 62 const base::Feature kNtpTilesFeature{"NTPTilesInInstantService", | 62 const base::Feature kNtpTilesFeature{"NTPTilesInInstantService", |
| 63 base::FEATURE_DISABLED_BY_DEFAULT}; | 63 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 64 | 64 |
| 65 } // namespace | 65 } // namespace |
| 66 | 66 |
| 67 InstantService::InstantService(Profile* profile) | 67 InstantService::InstantService(Profile* profile) |
| 68 : profile_(profile), | 68 : profile_(profile), |
| 69 template_url_service_(TemplateURLServiceFactory::GetForProfile(profile_)), | 69 template_url_service_(TemplateURLServiceFactory::GetForProfile(profile_)), |
| 70 weak_ptr_factory_(this) { | 70 weak_ptr_factory_(this) { |
| 71 // The initialization below depends on a typical set of browser threads. Skip | 71 // The initialization below depends on a typical set of browser threads. Skip |
| 72 // it if we are running in a unit test without the full suite. | 72 // it if we are running in a unit test without the full suite. |
| 73 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) | 73 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 void InstantService::ResetInstantSearchPrerendererIfNecessary() { | 505 void InstantService::ResetInstantSearchPrerendererIfNecessary() { |
| 506 if (!search::IsInstantExtendedAPIEnabled()) | 506 if (!search::IsInstantExtendedAPIEnabled()) |
| 507 return; | 507 return; |
| 508 | 508 |
| 509 GURL url(search::GetSearchResultPrefetchBaseURL(profile_)); | 509 GURL url(search::GetSearchResultPrefetchBaseURL(profile_)); |
| 510 if (!instant_prerenderer_ || instant_prerenderer_->prerender_url() != url) { | 510 if (!instant_prerenderer_ || instant_prerenderer_->prerender_url() != url) { |
| 511 instant_prerenderer_.reset( | 511 instant_prerenderer_.reset( |
| 512 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : nullptr); | 512 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : nullptr); |
| 513 } | 513 } |
| 514 } | 514 } |
| OLD | NEW |