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/extension_prefs.h" | 5 #include "chrome/browser/extensions/extension_prefs.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/extension_pref_store.h" | 10 #include "chrome/browser/extensions/extension_pref_store.h" |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 int max_value = -1; | 1094 int max_value = -1; |
1095 for (DictionaryValue::key_iterator extension_id = extensions->begin_keys(); | 1095 for (DictionaryValue::key_iterator extension_id = extensions->begin_keys(); |
1096 extension_id != extensions->end_keys(); ++extension_id) { | 1096 extension_id != extensions->end_keys(); ++extension_id) { |
1097 int value = GetAppLaunchIndex(*extension_id); | 1097 int value = GetAppLaunchIndex(*extension_id); |
1098 if (value > max_value) | 1098 if (value > max_value) |
1099 max_value = value; | 1099 max_value = value; |
1100 } | 1100 } |
1101 return max_value + 1; | 1101 return max_value + 1; |
1102 } | 1102 } |
1103 | 1103 |
| 1104 void ExtensionPrefs::SetAppLauncherOrder( |
| 1105 const std::vector<std::string>& extension_ids) { |
| 1106 for (size_t i = 0; i < extension_ids.size(); ++i) |
| 1107 SetAppLaunchIndex(extension_ids.at(i), i); |
| 1108 |
| 1109 NotificationService::current()->Notify( |
| 1110 NotificationType::EXTENSION_LAUNCHER_REORDERED, |
| 1111 Source<ExtensionPrefs>(this), |
| 1112 NotificationService::NoDetails()); |
| 1113 } |
| 1114 |
1104 void ExtensionPrefs::SetUpdateUrlData(const std::string& extension_id, | 1115 void ExtensionPrefs::SetUpdateUrlData(const std::string& extension_id, |
1105 const std::string& data) { | 1116 const std::string& data) { |
1106 DictionaryValue* dictionary = GetExtensionPref(extension_id); | 1117 DictionaryValue* dictionary = GetExtensionPref(extension_id); |
1107 if (!dictionary) { | 1118 if (!dictionary) { |
1108 NOTREACHED(); | 1119 NOTREACHED(); |
1109 return; | 1120 return; |
1110 } | 1121 } |
1111 | 1122 |
1112 dictionary->SetString(kUpdateUrlData, data); | 1123 dictionary->SetString(kUpdateUrlData, data); |
1113 SavePrefsAndNotify(); | 1124 SavePrefsAndNotify(); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { | 1311 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { |
1301 prefs->RegisterDictionaryPref(kExtensionsPref); | 1312 prefs->RegisterDictionaryPref(kExtensionsPref); |
1302 prefs->RegisterListPref(kExtensionToolbar); | 1313 prefs->RegisterListPref(kExtensionToolbar); |
1303 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); | 1314 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); |
1304 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); | 1315 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); |
1305 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); | 1316 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); |
1306 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); | 1317 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); |
1307 prefs->RegisterListPref(prefs::kExtensionInstallForceList); | 1318 prefs->RegisterListPref(prefs::kExtensionInstallForceList); |
1308 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); | 1319 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); |
1309 } | 1320 } |
OLD | NEW |