| 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/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 Value::CreateBooleanValue(allow)); | 448 Value::CreateBooleanValue(allow)); |
| 449 SavePrefsAndNotify(); | 449 SavePrefsAndNotify(); |
| 450 } | 450 } |
| 451 | 451 |
| 452 ExtensionPrefs::LaunchType ExtensionPrefs::GetLaunchType( | 452 ExtensionPrefs::LaunchType ExtensionPrefs::GetLaunchType( |
| 453 const std::string& extension_id) { | 453 const std::string& extension_id) { |
| 454 int value; | 454 int value; |
| 455 if (ReadExtensionPrefInteger(extension_id, kPrefLaunchType, &value) && ( | 455 if (ReadExtensionPrefInteger(extension_id, kPrefLaunchType, &value) && ( |
| 456 value == LAUNCH_PINNED || | 456 value == LAUNCH_PINNED || |
| 457 value == LAUNCH_REGULAR || | 457 value == LAUNCH_REGULAR || |
| 458 value == LAUNCH_FULLSCREEN)) { | 458 value == LAUNCH_FULLSCREEN || |
| 459 value == LAUNCH_WINDOW)) { |
| 459 return static_cast<LaunchType>(value); | 460 return static_cast<LaunchType>(value); |
| 460 } | 461 } |
| 461 return LAUNCH_REGULAR; | 462 return LAUNCH_REGULAR; |
| 462 } | 463 } |
| 463 | 464 |
| 464 void ExtensionPrefs::SetLaunchType(const std::string& extension_id, | 465 void ExtensionPrefs::SetLaunchType(const std::string& extension_id, |
| 465 LaunchType launch_type) { | 466 LaunchType launch_type) { |
| 466 UpdateExtensionPref(extension_id, kPrefLaunchType, | 467 UpdateExtensionPref(extension_id, kPrefLaunchType, |
| 467 Value::CreateIntegerValue(static_cast<int>(launch_type))); | 468 Value::CreateIntegerValue(static_cast<int>(launch_type))); |
| 468 SavePrefsAndNotify(); | 469 SavePrefsAndNotify(); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { | 925 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { |
| 925 prefs->RegisterDictionaryPref(kExtensionsPref); | 926 prefs->RegisterDictionaryPref(kExtensionsPref); |
| 926 prefs->RegisterListPref(kExtensionToolbar); | 927 prefs->RegisterListPref(kExtensionToolbar); |
| 927 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); | 928 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); |
| 928 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); | 929 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); |
| 929 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); | 930 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); |
| 930 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); | 931 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); |
| 931 prefs->RegisterListPref(prefs::kExtensionInstallForceList); | 932 prefs->RegisterListPref(prefs::kExtensionInstallForceList); |
| 932 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); | 933 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); |
| 933 } | 934 } |
| OLD | NEW |