Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/default_apps.h" | 5 #include "chrome/browser/extensions/default_apps.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 | 11 |
| 12 const int DefaultApps::kAppsPromoCounterMax = 10; | 12 const int DefaultApps::kAppsPromoCounterMax = 10; |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 void DefaultApps::RegisterUserPrefs(PrefService* prefs) { | 15 void DefaultApps::RegisterUserPrefs(PrefService* prefs) { |
| 16 prefs->RegisterBooleanPref(prefs::kDefaultAppsInstalled, false); | 16 prefs->RegisterBooleanPref(prefs::kDefaultAppsInstalled, false); |
| 17 prefs->RegisterIntegerPref(prefs::kAppsPromoCounter, 0); | 17 prefs->RegisterIntegerPref(prefs::kAppsPromoCounter, 0); |
| 18 } | 18 } |
| 19 | 19 |
| 20 DefaultApps::DefaultApps(PrefService* prefs) | 20 DefaultApps::DefaultApps(PrefService* prefs) |
| 21 : prefs_(prefs) { | 21 : prefs_(prefs) { |
| 22 #if !defined(OS_CHROMEOS) | |
| 22 // gmail, calendar, docs | 23 // gmail, calendar, docs |
| 23 ids_.insert("pjkljhegncpnkpknbcohdijeoejaedia"); | 24 ids_.insert("pjkljhegncpnkpknbcohdijeoejaedia"); |
| 24 ids_.insert("ejjicmeblgpmajnghnpcppodonldlgfn"); | 25 ids_.insert("ejjicmeblgpmajnghnpcppodonldlgfn"); |
| 25 ids_.insert("apdfllckaahabafndbhieahigkjlhalf"); | 26 ids_.insert("apdfllckaahabafndbhieahigkjlhalf"); |
| 27 #endif // OS_CHROMEOS | |
|
Aaron Boodman
2010/11/04 21:31:07
One thing I just realized: I think that this will
Dmitry Polukhin
2010/11/05 06:39:29
Indeed, I don't see it anymore. I'll take a look h
| |
| 26 } | 28 } |
| 27 | 29 |
| 28 const ExtensionIdSet* DefaultApps::GetAppsToInstall() const { | 30 const ExtensionIdSet* DefaultApps::GetAppsToInstall() const { |
| 29 if (GetDefaultAppsInstalled()) | 31 if (GetDefaultAppsInstalled()) |
| 30 return NULL; | 32 return NULL; |
| 31 else | 33 else |
| 32 return &ids_; | 34 return &ids_; |
| 33 } | 35 } |
| 34 | 36 |
| 35 const ExtensionIdSet* DefaultApps::GetDefaultApps() const { | 37 const ExtensionIdSet* DefaultApps::GetDefaultApps() const { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 } | 102 } |
| 101 | 103 |
| 102 bool DefaultApps::GetDefaultAppsInstalled() const { | 104 bool DefaultApps::GetDefaultAppsInstalled() const { |
| 103 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled); | 105 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled); |
| 104 } | 106 } |
| 105 | 107 |
| 106 void DefaultApps::SetDefaultAppsInstalled(bool val) { | 108 void DefaultApps::SetDefaultAppsInstalled(bool val) { |
| 107 prefs_->SetBoolean(prefs::kDefaultAppsInstalled, val); | 109 prefs_->SetBoolean(prefs::kDefaultAppsInstalled, val); |
| 108 prefs_->ScheduleSavePersistentPrefs(); | 110 prefs_->ScheduleSavePersistentPrefs(); |
| 109 } | 111 } |
| OLD | NEW |