| OLD | NEW | 
|---|
| 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/command_line.h" | 7 #include "base/command_line.h" | 
| 8 #include "base/prefs/pref_notifier.h" | 8 #include "base/prefs/pref_notifier.h" | 
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" | 
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" | 
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" | 
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" | 
| 13 #include "base/version.h" | 13 #include "base/version.h" | 
| 14 #include "chrome/browser/extensions/admin_policy.h" | 14 #include "chrome/browser/extensions/admin_policy.h" | 
| 15 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 15 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 
| 16 #include "chrome/browser/extensions/extension_pref_store.h" | 16 #include "chrome/browser/extensions/extension_pref_store.h" | 
| 17 #include "chrome/browser/extensions/extension_sorting.h" | 17 #include "chrome/browser/extensions/extension_sorting.h" | 
| 18 #include "chrome/browser/prefs/pref_registry_syncable.h" | 18 #include "chrome/browser/prefs/pref_registry_syncable.h" | 
| 19 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 19 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 
| 20 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" | 
| 21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" | 
| 22 #include "chrome/common/chrome_version_info.h" | 22 #include "chrome/common/chrome_version_info.h" | 
|  | 23 #include "chrome/common/extensions/app_launch_manifest_handler.h" | 
| 23 #include "chrome/common/extensions/feature_switch.h" | 24 #include "chrome/common/extensions/feature_switch.h" | 
| 24 #include "chrome/common/extensions/manifest.h" | 25 #include "chrome/common/extensions/manifest.h" | 
| 25 #include "chrome/common/extensions/permissions/permission_set.h" | 26 #include "chrome/common/extensions/permissions/permission_set.h" | 
| 26 #include "chrome/common/extensions/permissions/permissions_info.h" | 27 #include "chrome/common/extensions/permissions/permissions_info.h" | 
| 27 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" | 
| 28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" | 
| 29 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" | 
| 30 #include "extensions/common/url_pattern.h" | 31 #include "extensions/common/url_pattern.h" | 
| 31 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" | 
| 32 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" | 
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1205       result = LAUNCH_REGULAR; | 1206       result = LAUNCH_REGULAR; | 
| 1206 #endif  // OS_WIN | 1207 #endif  // OS_WIN | 
| 1207 | 1208 | 
| 1208   return result; | 1209   return result; | 
| 1209 } | 1210 } | 
| 1210 | 1211 | 
| 1211 extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer( | 1212 extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer( | 
| 1212     const Extension* extension, | 1213     const Extension* extension, | 
| 1213     ExtensionPrefs::LaunchType default_pref_value) { | 1214     ExtensionPrefs::LaunchType default_pref_value) { | 
| 1214   extension_misc::LaunchContainer manifest_launch_container = | 1215   extension_misc::LaunchContainer manifest_launch_container = | 
| 1215       extension->launch_container(); | 1216       AppLaunchInfo::GetLaunchContainer(extension); | 
| 1216 | 1217 | 
| 1217   const extension_misc::LaunchContainer kInvalidLaunchContainer = | 1218   const extension_misc::LaunchContainer kInvalidLaunchContainer = | 
| 1218       static_cast<extension_misc::LaunchContainer>(-1); | 1219       static_cast<extension_misc::LaunchContainer>(-1); | 
| 1219 | 1220 | 
| 1220   extension_misc::LaunchContainer result = kInvalidLaunchContainer; | 1221   extension_misc::LaunchContainer result = kInvalidLaunchContainer; | 
| 1221 | 1222 | 
| 1222   if (manifest_launch_container == extension_misc::LAUNCH_PANEL) { | 1223   if (manifest_launch_container == extension_misc::LAUNCH_PANEL) { | 
| 1223     // Apps with app.launch.container = 'panel' should always respect the | 1224     // Apps with app.launch.container = 'panel' should always respect the | 
| 1224     // manifest setting. | 1225     // manifest setting. | 
| 1225     result = manifest_launch_container; | 1226     result = manifest_launch_container; | 
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2364     is_enabled = initial_state == Extension::ENABLED; | 2365     is_enabled = initial_state == Extension::ENABLED; | 
| 2365   } | 2366   } | 
| 2366 | 2367 | 
| 2367   extension_pref_value_map_->RegisterExtension(extension_id, install_time, | 2368   extension_pref_value_map_->RegisterExtension(extension_id, install_time, | 
| 2368                                                is_enabled); | 2369                                                is_enabled); | 
| 2369   content_settings_store_->RegisterExtension(extension_id, install_time, | 2370   content_settings_store_->RegisterExtension(extension_id, install_time, | 
| 2370                                              is_enabled); | 2371                                              is_enabled); | 
| 2371 } | 2372 } | 
| 2372 | 2373 | 
| 2373 }  // namespace extensions | 2374 }  // namespace extensions | 
| OLD | NEW | 
|---|