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

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

Issue 10080017: Switch platform apps from a declarative launch container to handling an onLaunched event. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: remove debug logging code 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/api/alarms/alarm_manager.h" 10 #include "chrome/browser/extensions/api/alarms/alarm_manager.h"
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 const Extension* extension, 1031 const Extension* extension,
1032 ExtensionPrefs::LaunchType default_pref_value) { 1032 ExtensionPrefs::LaunchType default_pref_value) {
1033 extension_misc::LaunchContainer manifest_launch_container = 1033 extension_misc::LaunchContainer manifest_launch_container =
1034 extension->launch_container(); 1034 extension->launch_container();
1035 1035
1036 const extension_misc::LaunchContainer kInvalidLaunchContainer = 1036 const extension_misc::LaunchContainer kInvalidLaunchContainer =
1037 static_cast<extension_misc::LaunchContainer>(-1); 1037 static_cast<extension_misc::LaunchContainer>(-1);
1038 1038
1039 extension_misc::LaunchContainer result = kInvalidLaunchContainer; 1039 extension_misc::LaunchContainer result = kInvalidLaunchContainer;
1040 1040
1041 if (manifest_launch_container == extension_misc::LAUNCH_PANEL || 1041 if (manifest_launch_container == extension_misc::LAUNCH_PANEL) {
1042 manifest_launch_container == extension_misc::LAUNCH_SHELL) { 1042 // Apps with app.launch.container = 'panel' should always respect the
1043 // Apps with app.launch.container = 'panel' or 'shell' should always respect 1043 // manifest setting.
1044 // the manifest setting.
1045 result = manifest_launch_container; 1044 result = manifest_launch_container;
1046
1047 } else if (manifest_launch_container == extension_misc::LAUNCH_TAB) { 1045 } else if (manifest_launch_container == extension_misc::LAUNCH_TAB) {
1048 // Look for prefs that indicate the user's choice of launch 1046 // Look for prefs that indicate the user's choice of launch
1049 // container. The app's menu on the NTP provides a UI to set 1047 // container. The app's menu on the NTP provides a UI to set
1050 // this preference. If no preference is set, |default_pref_value| 1048 // this preference. If no preference is set, |default_pref_value|
1051 // is used. 1049 // is used.
1052 ExtensionPrefs::LaunchType prefs_launch_type = 1050 ExtensionPrefs::LaunchType prefs_launch_type =
1053 GetLaunchType(extension->id(), default_pref_value); 1051 GetLaunchType(extension->id(), default_pref_value);
1054 1052
1055 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) { 1053 if (prefs_launch_type == ExtensionPrefs::LAUNCH_WINDOW) {
1056 // If the pref is set to launch a window (or no pref is set, and 1054 // If the pref is set to launch a window (or no pref is set, and
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 prefs->RegisterStringPref(prefs::kExtensionBlacklistUpdateVersion, 1845 prefs->RegisterStringPref(prefs::kExtensionBlacklistUpdateVersion,
1848 "0", // default value 1846 "0", // default value
1849 PrefService::UNSYNCABLE_PREF); 1847 PrefService::UNSYNCABLE_PREF);
1850 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, 1848 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck,
1851 0, // default value 1849 0, // default value
1852 PrefService::UNSYNCABLE_PREF); 1850 PrefService::UNSYNCABLE_PREF);
1853 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, 1851 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck,
1854 0, // default value 1852 0, // default value
1855 PrefService::UNSYNCABLE_PREF); 1853 PrefService::UNSYNCABLE_PREF);
1856 } 1854 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_registry.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698