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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/common/extensions/permissions/permission_set.h" | 25 #include "chrome/common/extensions/permissions/permission_set.h" |
26 #include "chrome/common/extensions/permissions/permissions_info.h" | 26 #include "chrome/common/extensions/permissions/permissions_info.h" |
27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
29 #include "components/user_prefs/pref_registry_syncable.h" | 29 #include "components/user_prefs/pref_registry_syncable.h" |
30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
31 #include "extensions/common/url_pattern.h" | 31 #include "extensions/common/url_pattern.h" |
32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
34 | 34 |
| 35 #if defined(USE_ASH) |
| 36 #include "ash/shell.h" |
| 37 #endif |
35 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
36 #include "win8/util/win8_util.h" | 39 #include "win8/util/win8_util.h" |
37 #endif // OS_WIN | 40 #endif // OS_WIN |
38 | 41 |
39 using base::Value; | 42 using base::Value; |
40 using base::DictionaryValue; | 43 using base::DictionaryValue; |
41 using base::ListValue; | 44 using base::ListValue; |
42 | 45 |
43 namespace extensions { | 46 namespace extensions { |
44 | 47 |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 | 1253 |
1251 if (ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value) && | 1254 if (ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value) && |
1252 (value == LAUNCH_PINNED || | 1255 (value == LAUNCH_PINNED || |
1253 value == LAUNCH_REGULAR || | 1256 value == LAUNCH_REGULAR || |
1254 value == LAUNCH_FULLSCREEN || | 1257 value == LAUNCH_FULLSCREEN || |
1255 value == LAUNCH_WINDOW)) { | 1258 value == LAUNCH_WINDOW)) { |
1256 result = static_cast<LaunchType>(value); | 1259 result = static_cast<LaunchType>(value); |
1257 } else { | 1260 } else { |
1258 result = default_pref_value; | 1261 result = default_pref_value; |
1259 } | 1262 } |
1260 #if defined(OS_MACOSX) | 1263 #if (USE_ASH) |
| 1264 if (ash::Shell::IsForcedMaximizeMode() && |
| 1265 (result == LAUNCH_FULLSCREEN || result == LAUNCH_WINDOW)) |
| 1266 result = LAUNCH_REGULAR; |
| 1267 #endif |
| 1268 #if defined(OS_MACOSX) |
1261 // App windows are not yet supported on mac. Pref sync could make | 1269 // App windows are not yet supported on mac. Pref sync could make |
1262 // the launch type LAUNCH_WINDOW, even if there is no UI to set it | 1270 // the launch type LAUNCH_WINDOW, even if there is no UI to set it |
1263 // on mac. | 1271 // on mac. |
1264 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) | 1272 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) |
1265 result = LAUNCH_REGULAR; | 1273 result = LAUNCH_REGULAR; |
1266 #endif | 1274 #endif |
1267 | 1275 |
1268 #if defined(OS_WIN) | 1276 #if defined(OS_WIN) |
1269 // We don't support app windows in Windows 8 single window Metro mode. | 1277 // We don't support app windows in Windows 8 single window Metro mode. |
1270 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW) | 1278 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW) |
1271 result = LAUNCH_REGULAR; | 1279 result = LAUNCH_REGULAR; |
1272 #endif // OS_WIN | 1280 #endif // OS_WIN |
1273 | 1281 |
1274 return result; | 1282 return result; |
1275 } | 1283 } |
1276 | 1284 |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2240 is_enabled = initial_state == Extension::ENABLED; | 2248 is_enabled = initial_state == Extension::ENABLED; |
2241 } | 2249 } |
2242 | 2250 |
2243 extension_pref_value_map_->RegisterExtension(extension_id, install_time, | 2251 extension_pref_value_map_->RegisterExtension(extension_id, install_time, |
2244 is_enabled); | 2252 is_enabled); |
2245 content_settings_store_->RegisterExtension(extension_id, install_time, | 2253 content_settings_store_->RegisterExtension(extension_id, install_time, |
2246 is_enabled); | 2254 is_enabled); |
2247 } | 2255 } |
2248 | 2256 |
2249 } // namespace extensions | 2257 } // namespace extensions |
OLD | NEW |