| 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/prefs/pref_notifier.h" | 10 #include "chrome/browser/prefs/pref_notifier.h" |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 | 597 |
| 598 return result; | 598 return result; |
| 599 } | 599 } |
| 600 | 600 |
| 601 extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer( | 601 extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer( |
| 602 const Extension* extension, | 602 const Extension* extension, |
| 603 ExtensionPrefs::LaunchType default_pref_value) { | 603 ExtensionPrefs::LaunchType default_pref_value) { |
| 604 extension_misc::LaunchContainer launch_container = | 604 extension_misc::LaunchContainer launch_container = |
| 605 extension->launch_container(); | 605 extension->launch_container(); |
| 606 | 606 |
| 607 // Apps with app.launch.container = 'panel' should always |
| 608 // open in a panel. |
| 609 if (launch_container == extension_misc::LAUNCH_PANEL) |
| 610 return extension_misc::LAUNCH_PANEL; |
| 611 |
| 607 ExtensionPrefs::LaunchType prefs_launch_type = | 612 ExtensionPrefs::LaunchType prefs_launch_type = |
| 608 GetLaunchType(extension->id(), default_pref_value); | 613 GetLaunchType(extension->id(), default_pref_value); |
| 609 | 614 |
| 610 // If the user chose to open in a window, then launch in one. | 615 // If the user chose to open in a window, then launch in one. |
| 611 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) | 616 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) |
| 612 return extension_misc::LAUNCH_WINDOW; | 617 return extension_misc::LAUNCH_WINDOW; |
| 613 | 618 |
| 614 // Otherwise, use the container the extension chose. | 619 // Otherwise, use the container the extension chose. |
| 615 return launch_container; | 620 return launch_container; |
| 616 } | 621 } |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { | 1294 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { |
| 1290 prefs->RegisterDictionaryPref(kExtensionsPref); | 1295 prefs->RegisterDictionaryPref(kExtensionsPref); |
| 1291 prefs->RegisterListPref(kExtensionToolbar); | 1296 prefs->RegisterListPref(kExtensionToolbar); |
| 1292 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); | 1297 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); |
| 1293 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); | 1298 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); |
| 1294 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); | 1299 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); |
| 1295 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); | 1300 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); |
| 1296 prefs->RegisterListPref(prefs::kExtensionInstallForceList); | 1301 prefs->RegisterListPref(prefs::kExtensionInstallForceList); |
| 1297 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); | 1302 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); |
| 1298 } | 1303 } |
| OLD | NEW |