| 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/ntp_tiles/chrome_most_visited_sites_factory.h" | 5 #include "chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (supervisor_observer_) { | 101 if (supervisor_observer_) { |
| 102 supervisor_observer_->OnBlockedSitesChanged(); | 102 supervisor_observer_->OnBlockedSitesChanged(); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace | 106 } // namespace |
| 107 | 107 |
| 108 // static | 108 // static |
| 109 std::unique_ptr<ntp_tiles::MostVisitedSites> | 109 std::unique_ptr<ntp_tiles::MostVisitedSites> |
| 110 ChromeMostVisitedSitesFactory::NewForProfile(Profile* profile) { | 110 ChromeMostVisitedSitesFactory::NewForProfile(Profile* profile) { |
| 111 // MostVisitedSites doesn't exist in incognito profiles. |
| 112 if (profile->IsOffTheRecord()) { |
| 113 return nullptr; |
| 114 } |
| 115 |
| 111 return base::MakeUnique<ntp_tiles::MostVisitedSites>( | 116 return base::MakeUnique<ntp_tiles::MostVisitedSites>( |
| 112 profile->GetPrefs(), TopSitesFactory::GetForProfile(profile), | 117 profile->GetPrefs(), TopSitesFactory::GetForProfile(profile), |
| 113 SuggestionsServiceFactory::GetForProfile(profile), | 118 SuggestionsServiceFactory::GetForProfile(profile), |
| 114 #if defined(OS_ANDROID) | 119 #if defined(OS_ANDROID) |
| 115 ChromePopularSitesFactory::NewForProfile(profile), | 120 ChromePopularSitesFactory::NewForProfile(profile), |
| 116 #else | 121 #else |
| 117 nullptr, | 122 nullptr, |
| 118 #endif | 123 #endif |
| 119 base::MakeUnique<ntp_tiles::IconCacherImpl>( | 124 base::MakeUnique<ntp_tiles::IconCacherImpl>( |
| 120 FaviconServiceFactory::GetForProfile( | 125 FaviconServiceFactory::GetForProfile( |
| 121 profile, ServiceAccessType::IMPLICIT_ACCESS), | 126 profile, ServiceAccessType::IMPLICIT_ACCESS), |
| 122 base::MakeUnique<image_fetcher::ImageFetcherImpl>( | 127 base::MakeUnique<image_fetcher::ImageFetcherImpl>( |
| 123 base::MakeUnique<suggestions::ImageDecoderImpl>(), | 128 base::MakeUnique<suggestions::ImageDecoderImpl>(), |
| 124 profile->GetRequestContext())), | 129 profile->GetRequestContext())), |
| 125 base::MakeUnique<SupervisorBridge>(profile)); | 130 base::MakeUnique<SupervisorBridge>(profile)); |
| 126 } | 131 } |
| OLD | NEW |