Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: chrome/browser/extensions/extension_prefs.cc

Issue 8734016: Make platform apps use and require a different container ("shell" instead of "panel") (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extension_prefs.h" 5 #include "chrome/browser/extensions/extension_prefs.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/string_util.h" 8 #include "base/string_util.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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 const Extension* extension, 966 const Extension* extension,
967 ExtensionPrefs::LaunchType default_pref_value) { 967 ExtensionPrefs::LaunchType default_pref_value) {
968 extension_misc::LaunchContainer manifest_launch_container = 968 extension_misc::LaunchContainer manifest_launch_container =
969 extension->launch_container(); 969 extension->launch_container();
970 970
971 const extension_misc::LaunchContainer kInvalidLaunchContainer = 971 const extension_misc::LaunchContainer kInvalidLaunchContainer =
972 static_cast<extension_misc::LaunchContainer>(-1); 972 static_cast<extension_misc::LaunchContainer>(-1);
973 973
974 extension_misc::LaunchContainer result = kInvalidLaunchContainer; 974 extension_misc::LaunchContainer result = kInvalidLaunchContainer;
975 975
976 if (manifest_launch_container == extension_misc::LAUNCH_PANEL) { 976 if (manifest_launch_container == extension_misc::LAUNCH_PANEL ||
977 // Apps with app.launch.container = 'panel' should always 977 manifest_launch_container == extension_misc::LAUNCH_SHELL) {
978 // open in a panel. 978 // Apps with app.launch.container = 'panel' or 'shell' should always respect
979 result = extension_misc::LAUNCH_PANEL; 979 // the manifest setting.
980 result = manifest_launch_container;
980 981
981 } else if (manifest_launch_container == extension_misc::LAUNCH_TAB) { 982 } else if (manifest_launch_container == extension_misc::LAUNCH_TAB) {
982 // Look for prefs that indicate the user's choice of launch 983 // Look for prefs that indicate the user's choice of launch
983 // container. The app's menu on the NTP provides a UI to set 984 // container. The app's menu on the NTP provides a UI to set
984 // this preference. If no preference is set, |default_pref_value| 985 // this preference. If no preference is set, |default_pref_value|
985 // is used. 986 // is used.
986 ExtensionPrefs::LaunchType prefs_launch_type = 987 ExtensionPrefs::LaunchType prefs_launch_type =
987 GetLaunchType(extension->id(), default_pref_value); 988 GetLaunchType(extension->id(), default_pref_value);
988 989
989 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) { 990 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) {
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 prefs->RegisterListPref(prefs::kExtensionInstallAllowList, 1823 prefs->RegisterListPref(prefs::kExtensionInstallAllowList,
1823 PrefService::UNSYNCABLE_PREF); 1824 PrefService::UNSYNCABLE_PREF);
1824 prefs->RegisterListPref(prefs::kExtensionInstallDenyList, 1825 prefs->RegisterListPref(prefs::kExtensionInstallDenyList,
1825 PrefService::UNSYNCABLE_PREF); 1826 PrefService::UNSYNCABLE_PREF);
1826 prefs->RegisterListPref(prefs::kExtensionInstallForceList, 1827 prefs->RegisterListPref(prefs::kExtensionInstallForceList,
1827 PrefService::UNSYNCABLE_PREF); 1828 PrefService::UNSYNCABLE_PREF);
1828 prefs->RegisterStringPref(kWebStoreLogin, 1829 prefs->RegisterStringPref(kWebStoreLogin,
1829 std::string() /* default_value */, 1830 std::string() /* default_value */,
1830 PrefService::UNSYNCABLE_PREF); 1831 PrefService::UNSYNCABLE_PREF);
1831 } 1832 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698