| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/apps_promo.h" | 5 #include "chrome/browser/extensions/apps_promo.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 void AppsPromo::SetLastPromoId(const std::string& id) { | 289 void AppsPromo::SetLastPromoId(const std::string& id) { |
| 290 prefs_->SetString(prefs::kNTPWebStorePromoLastId, id); | 290 prefs_->SetString(prefs::kNTPWebStorePromoLastId, id); |
| 291 } | 291 } |
| 292 | 292 |
| 293 int AppsPromo::GetPromoCounter() const { | 293 int AppsPromo::GetPromoCounter() const { |
| 294 return prefs_->GetInteger(prefs::kAppsPromoCounter); | 294 return prefs_->GetInteger(prefs::kAppsPromoCounter); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void AppsPromo::SetPromoCounter(int val) { | 297 void AppsPromo::SetPromoCounter(int val) { |
| 298 prefs_->SetInteger(prefs::kAppsPromoCounter, val); | 298 prefs_->SetInteger(prefs::kAppsPromoCounter, val); |
| 299 prefs_->ScheduleSavePersistentPrefs(); | |
| 300 } | 299 } |
| 301 | 300 |
| 302 bool AppsPromo::GetDefaultAppsInstalled() const { | 301 bool AppsPromo::GetDefaultAppsInstalled() const { |
| 303 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled); | 302 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled); |
| 304 } | 303 } |
| 305 | 304 |
| 306 AppsPromo::UserGroup AppsPromo::GetCurrentUserGroup() const { | 305 AppsPromo::UserGroup AppsPromo::GetCurrentUserGroup() const { |
| 307 const PrefService::Preference* last_promo_id | 306 const PrefService::Preference* last_promo_id |
| 308 = prefs_->FindPreference(prefs::kNTPWebStorePromoLastId); | 307 = prefs_->FindPreference(prefs::kNTPWebStorePromoLastId); |
| 309 CHECK(last_promo_id); | 308 CHECK(last_promo_id); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 content::NotificationService::current()->Notify( | 375 content::NotificationService::current()->Notify( |
| 377 chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED, | 376 chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED, |
| 378 content::Source<Profile>(profile_), | 377 content::Source<Profile>(profile_), |
| 379 content::NotificationService::NoDetails()); | 378 content::NotificationService::NoDetails()); |
| 380 } | 379 } |
| 381 | 380 |
| 382 bool AppsPromoLogoFetcher::SupportsLogoURL() { | 381 bool AppsPromoLogoFetcher::SupportsLogoURL() { |
| 383 URLPattern allowed_urls(URLPattern::SCHEME_HTTPS, kValidLogoPattern); | 382 URLPattern allowed_urls(URLPattern::SCHEME_HTTPS, kValidLogoPattern); |
| 384 return allowed_urls.MatchesURL(promo_data_.logo); | 383 return allowed_urls.MatchesURL(promo_data_.logo); |
| 385 } | 384 } |
| OLD | NEW |