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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chrome/common/extensions/permissions/permission_set.h" | 24 #include "chrome/common/extensions/permissions/permission_set.h" |
25 #include "chrome/common/extensions/permissions/permissions_info.h" | 25 #include "chrome/common/extensions/permissions/permissions_info.h" |
26 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
28 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
29 #include "extensions/common/url_pattern.h" | 29 #include "extensions/common/url_pattern.h" |
30 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include "base/win/metro.h" | 34 #include "win8/util/win8_util.h" |
35 #endif // OS_WIN | 35 #endif // OS_WIN |
36 | 36 |
37 namespace extensions { | 37 namespace extensions { |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 // Additional preferences keys | 41 // Additional preferences keys |
42 | 42 |
43 // Whether this extension was running when chrome last shutdown. | 43 // Whether this extension was running when chrome last shutdown. |
44 const char kPrefRunning[] = "running"; | 44 const char kPrefRunning[] = "running"; |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 } | 1215 } |
1216 #if defined(OS_MACOSX) | 1216 #if defined(OS_MACOSX) |
1217 // App windows are not yet supported on mac. Pref sync could make | 1217 // App windows are not yet supported on mac. Pref sync could make |
1218 // the launch type LAUNCH_WINDOW, even if there is no UI to set it | 1218 // the launch type LAUNCH_WINDOW, even if there is no UI to set it |
1219 // on mac. | 1219 // on mac. |
1220 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) | 1220 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) |
1221 result = LAUNCH_REGULAR; | 1221 result = LAUNCH_REGULAR; |
1222 #endif | 1222 #endif |
1223 | 1223 |
1224 #if defined(OS_WIN) | 1224 #if defined(OS_WIN) |
1225 // We don't support app windows in windows 8 metro mode. | 1225 // We don't support app windows in Windows 8 single window Metro mode. |
1226 if (base::win::IsMetroProcess() && result == LAUNCH_WINDOW) | 1226 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW) |
1227 result = LAUNCH_REGULAR; | 1227 result = LAUNCH_REGULAR; |
1228 #endif // OS_WIN | 1228 #endif // OS_WIN |
1229 | 1229 |
1230 return result; | 1230 return result; |
1231 } | 1231 } |
1232 | 1232 |
1233 extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer( | 1233 extension_misc::LaunchContainer ExtensionPrefs::GetLaunchContainer( |
1234 const Extension* extension, | 1234 const Extension* extension, |
1235 ExtensionPrefs::LaunchType default_pref_value) { | 1235 ExtensionPrefs::LaunchType default_pref_value) { |
1236 extension_misc::LaunchContainer manifest_launch_container = | 1236 extension_misc::LaunchContainer manifest_launch_container = |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 const ExtensionIdList& strings) { | 2320 const ExtensionIdList& strings) { |
2321 ListPrefUpdate update(prefs_, pref); | 2321 ListPrefUpdate update(prefs_, pref); |
2322 ListValue* list_of_values = update.Get(); | 2322 ListValue* list_of_values = update.Get(); |
2323 list_of_values->Clear(); | 2323 list_of_values->Clear(); |
2324 for (ExtensionIdList::const_iterator iter = strings.begin(); | 2324 for (ExtensionIdList::const_iterator iter = strings.begin(); |
2325 iter != strings.end(); ++iter) | 2325 iter != strings.end(); ++iter) |
2326 list_of_values->Append(new StringValue(*iter)); | 2326 list_of_values->Append(new StringValue(*iter)); |
2327 } | 2327 } |
2328 | 2328 |
2329 } // namespace extensions | 2329 } // namespace extensions |
OLD | NEW |