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

Side by Side Diff: components/ntp_tiles/popular_sites_impl.cc

Issue 2962363002: Revert of Disable baked-in popular sites for iOS. (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | components/ntp_tiles/popular_sites_impl_unittest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/ntp_tiles/popular_sites_impl.h" 5 #include "components/ntp_tiles/popular_sites_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 base::DictionaryValue* site; 146 base::DictionaryValue* site;
147 if (!sites->GetDictionary(index, &site)) { 147 if (!sites->GetDictionary(index, &site)) {
148 return; 148 return;
149 } 149 }
150 site->SetInteger("default_icon_resource", resource_id); 150 site->SetInteger("default_icon_resource", resource_id);
151 } 151 }
152 #endif 152 #endif
153 153
154 // Creates the list of popular sites based on a snapshot available for mobile. 154 // Creates the list of popular sites based on a snapshot available for mobile.
155 std::unique_ptr<base::ListValue> DefaultPopularSites() { 155 std::unique_ptr<base::ListValue> DefaultPopularSites() {
156 #if !defined(OS_ANDROID) 156 #if !defined(OS_ANDROID) && !defined(OS_IOS)
157 return base::MakeUnique<base::ListValue>(); 157 return base::MakeUnique<base::ListValue>();
158 #else 158 #else
159 if (!base::FeatureList::IsEnabled(kPopularSitesBakedInContentFeature)) { 159 if (!base::FeatureList::IsEnabled(kPopularSitesBakedInContentFeature)) {
160 return base::MakeUnique<base::ListValue>(); 160 return base::MakeUnique<base::ListValue>();
161 } 161 }
162 std::unique_ptr<base::ListValue> sites = 162 std::unique_ptr<base::ListValue> sites =
163 base::ListValue::From(base::JSONReader::Read( 163 base::ListValue::From(base::JSONReader::Read(
164 ResourceBundle::GetSharedInstance().GetRawDataResource( 164 ResourceBundle::GetSharedInstance().GetRawDataResource(
165 IDR_DEFAULT_POPULAR_SITES_JSON))); 165 IDR_DEFAULT_POPULAR_SITES_JSON)));
166 DCHECK(sites); 166 DCHECK(sites);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 kPopularSitesDefaultCountryCode, 433 kPopularSitesDefaultCountryCode,
434 kPopularSitesDefaultVersion); 434 kPopularSitesDefaultVersion);
435 FetchPopularSites(); 435 FetchPopularSites();
436 } else { 436 } else {
437 DLOG(WARNING) << "Download fallback site list failed"; 437 DLOG(WARNING) << "Download fallback site list failed";
438 callback_.Run(false); 438 callback_.Run(false);
439 } 439 }
440 } 440 }
441 441
442 } // namespace ntp_tiles 442 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « no previous file | components/ntp_tiles/popular_sites_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698