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 16 matching lines...) Expand all Loading... |
27 #include "chrome/common/extensions/permissions/permission_set.h" | 27 #include "chrome/common/extensions/permissions/permission_set.h" |
28 #include "chrome/common/extensions/permissions/permissions_info.h" | 28 #include "chrome/common/extensions/permissions/permissions_info.h" |
29 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
30 #include "chrome/common/url_constants.h" | 30 #include "chrome/common/url_constants.h" |
31 #include "components/user_prefs/pref_registry_syncable.h" | 31 #include "components/user_prefs/pref_registry_syncable.h" |
32 #include "content/public/browser/notification_service.h" | 32 #include "content/public/browser/notification_service.h" |
33 #include "extensions/common/url_pattern.h" | 33 #include "extensions/common/url_pattern.h" |
34 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
35 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
36 | 36 |
| 37 #if defined(USE_ASH) |
| 38 #include "ash/shell.h" |
| 39 #endif |
37 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
38 #include "win8/util/win8_util.h" | 41 #include "win8/util/win8_util.h" |
39 #endif // OS_WIN | 42 #endif // OS_WIN |
40 | 43 |
41 namespace extensions { | 44 namespace extensions { |
42 | 45 |
43 namespace { | 46 namespace { |
44 | 47 |
45 // Additional preferences keys | 48 // Additional preferences keys |
46 | 49 |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 | 1206 |
1204 if (ReadExtensionPrefInteger(extension->id(), kPrefLaunchType, &value) && | 1207 if (ReadExtensionPrefInteger(extension->id(), kPrefLaunchType, &value) && |
1205 (value == LAUNCH_PINNED || | 1208 (value == LAUNCH_PINNED || |
1206 value == LAUNCH_REGULAR || | 1209 value == LAUNCH_REGULAR || |
1207 value == LAUNCH_FULLSCREEN || | 1210 value == LAUNCH_FULLSCREEN || |
1208 value == LAUNCH_WINDOW)) { | 1211 value == LAUNCH_WINDOW)) { |
1209 result = static_cast<LaunchType>(value); | 1212 result = static_cast<LaunchType>(value); |
1210 } else { | 1213 } else { |
1211 result = default_pref_value; | 1214 result = default_pref_value; |
1212 } | 1215 } |
1213 #if defined(OS_MACOSX) | 1216 #if (USE_ASH) |
| 1217 if (ash::Shell::IsForcedMaximizeMode() && |
| 1218 (result == LAUNCH_FULLSCREEN || result == LAUNCH_WINDOW)) |
| 1219 result = LAUNCH_REGULAR; |
| 1220 #endif |
| 1221 #if defined(OS_MACOSX) |
1214 // App windows are not yet supported on mac. Pref sync could make | 1222 // App windows are not yet supported on mac. Pref sync could make |
1215 // the launch type LAUNCH_WINDOW, even if there is no UI to set it | 1223 // the launch type LAUNCH_WINDOW, even if there is no UI to set it |
1216 // on mac. | 1224 // on mac. |
1217 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) | 1225 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) |
1218 result = LAUNCH_REGULAR; | 1226 result = LAUNCH_REGULAR; |
1219 #endif | 1227 #endif |
1220 | 1228 |
1221 #if defined(OS_WIN) | 1229 #if defined(OS_WIN) |
1222 // We don't support app windows in Windows 8 single window Metro mode. | 1230 // We don't support app windows in Windows 8 single window Metro mode. |
1223 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW) | 1231 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW) |
1224 result = LAUNCH_REGULAR; | 1232 result = LAUNCH_REGULAR; |
1225 #endif // OS_WIN | 1233 #endif // OS_WIN |
1226 | 1234 |
1227 return result; | 1235 return result; |
1228 } | 1236 } |
1229 | 1237 |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2372 is_enabled = initial_state == Extension::ENABLED; | 2380 is_enabled = initial_state == Extension::ENABLED; |
2373 } | 2381 } |
2374 | 2382 |
2375 extension_pref_value_map_->RegisterExtension(extension_id, install_time, | 2383 extension_pref_value_map_->RegisterExtension(extension_id, install_time, |
2376 is_enabled); | 2384 is_enabled); |
2377 content_settings_store_->RegisterExtension(extension_id, install_time, | 2385 content_settings_store_->RegisterExtension(extension_id, install_time, |
2378 is_enabled); | 2386 is_enabled); |
2379 } | 2387 } |
2380 | 2388 |
2381 } // namespace extensions | 2389 } // namespace extensions |
OLD | NEW |