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

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

Issue 9969087: Switch platform apps from a declarative launch container to handling an onLaunched event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 8 years, 8 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 const Extension* extension, 978 const Extension* extension,
979 ExtensionPrefs::LaunchType default_pref_value) { 979 ExtensionPrefs::LaunchType default_pref_value) {
980 extension_misc::LaunchContainer manifest_launch_container = 980 extension_misc::LaunchContainer manifest_launch_container =
981 extension->launch_container(); 981 extension->launch_container();
982 982
983 const extension_misc::LaunchContainer kInvalidLaunchContainer = 983 const extension_misc::LaunchContainer kInvalidLaunchContainer =
984 static_cast<extension_misc::LaunchContainer>(-1); 984 static_cast<extension_misc::LaunchContainer>(-1);
985 985
986 extension_misc::LaunchContainer result = kInvalidLaunchContainer; 986 extension_misc::LaunchContainer result = kInvalidLaunchContainer;
987 987
988 if (manifest_launch_container == extension_misc::LAUNCH_PANEL || 988 if (manifest_launch_container == extension_misc::LAUNCH_PANEL) {
989 manifest_launch_container == extension_misc::LAUNCH_SHELL) { 989 // Apps with app.launch.container = 'panel' should always respect the
990 // Apps with app.launch.container = 'panel' or 'shell' should always respect 990 // manifest setting.
991 // the manifest setting.
992 result = manifest_launch_container; 991 result = manifest_launch_container;
993
994 } else if (manifest_launch_container == extension_misc::LAUNCH_TAB) { 992 } else if (manifest_launch_container == extension_misc::LAUNCH_TAB) {
995 // Look for prefs that indicate the user's choice of launch 993 // Look for prefs that indicate the user's choice of launch
996 // container. The app's menu on the NTP provides a UI to set 994 // container. The app's menu on the NTP provides a UI to set
997 // this preference. If no preference is set, |default_pref_value| 995 // this preference. If no preference is set, |default_pref_value|
998 // is used. 996 // is used.
999 ExtensionPrefs::LaunchType prefs_launch_type = 997 ExtensionPrefs::LaunchType prefs_launch_type =
1000 GetLaunchType(extension->id(), default_pref_value); 998 GetLaunchType(extension->id(), default_pref_value);
1001 999
1002 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) { 1000 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) {
1003 // If the pref is set to launch a window (or no pref is set, and 1001 // If the pref is set to launch a window (or no pref is set, and
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 prefs->RegisterStringPref(prefs::kExtensionBlacklistUpdateVersion, 1791 prefs->RegisterStringPref(prefs::kExtensionBlacklistUpdateVersion,
1794 "0", // default value 1792 "0", // default value
1795 PrefService::UNSYNCABLE_PREF); 1793 PrefService::UNSYNCABLE_PREF);
1796 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, 1794 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck,
1797 0, // default value 1795 0, // default value
1798 PrefService::UNSYNCABLE_PREF); 1796 PrefService::UNSYNCABLE_PREF);
1799 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, 1797 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck,
1800 0, // default value 1798 0, // default value
1801 PrefService::UNSYNCABLE_PREF); 1799 PrefService::UNSYNCABLE_PREF);
1802 } 1800 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698