| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 void AppsPromo::SetLastPromoId(const std::string& id) { | 305 void AppsPromo::SetLastPromoId(const std::string& id) { |
| 306 prefs_->SetString(prefs::kNTPWebStorePromoLastId, id); | 306 prefs_->SetString(prefs::kNTPWebStorePromoLastId, id); |
| 307 } | 307 } |
| 308 | 308 |
| 309 int AppsPromo::GetPromoCounter() const { | 309 int AppsPromo::GetPromoCounter() const { |
| 310 return prefs_->GetInteger(prefs::kAppsPromoCounter); | 310 return prefs_->GetInteger(prefs::kAppsPromoCounter); |
| 311 } | 311 } |
| 312 | 312 |
| 313 void AppsPromo::SetPromoCounter(int val) { | 313 void AppsPromo::SetPromoCounter(int val) { |
| 314 prefs_->SetInteger(prefs::kAppsPromoCounter, val); | 314 prefs_->SetInteger(prefs::kAppsPromoCounter, val); |
| 315 prefs_->ScheduleSavePersistentPrefs(); | |
| 316 } | 315 } |
| 317 | 316 |
| 318 bool AppsPromo::GetDefaultAppsInstalled() const { | 317 bool AppsPromo::GetDefaultAppsInstalled() const { |
| 319 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled); | 318 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled); |
| 320 } | 319 } |
| 321 | 320 |
| 322 AppsPromo::UserGroup AppsPromo::GetCurrentUserGroup() const { | 321 AppsPromo::UserGroup AppsPromo::GetCurrentUserGroup() const { |
| 323 const PrefService::Preference* last_promo_id | 322 const PrefService::Preference* last_promo_id |
| 324 = prefs_->FindPreference(prefs::kNTPWebStorePromoLastId); | 323 = prefs_->FindPreference(prefs::kNTPWebStorePromoLastId); |
| 325 CHECK(last_promo_id); | 324 CHECK(last_promo_id); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 NotificationService::current()->Notify( | 390 NotificationService::current()->Notify( |
| 392 chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED, | 391 chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED, |
| 393 Source<Profile>(profile_), | 392 Source<Profile>(profile_), |
| 394 NotificationService::NoDetails()); | 393 NotificationService::NoDetails()); |
| 395 } | 394 } |
| 396 | 395 |
| 397 bool AppsPromoLogoFetcher::SupportsLogoURL() { | 396 bool AppsPromoLogoFetcher::SupportsLogoURL() { |
| 398 URLPattern allowed_urls(URLPattern::SCHEME_HTTPS, kValidLogoPattern); | 397 URLPattern allowed_urls(URLPattern::SCHEME_HTTPS, kValidLogoPattern); |
| 399 return allowed_urls.MatchesURL(promo_data_.logo); | 398 return allowed_urls.MatchesURL(promo_data_.logo); |
| 400 } | 399 } |
| OLD | NEW |