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

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

Issue 13934007: Adding experimental maximize mode (behind a flag) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed flag usage again Created 7 years, 7 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/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
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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 1257
1255 if (ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value) && 1258 if (ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value) &&
1256 (value == LAUNCH_PINNED || 1259 (value == LAUNCH_PINNED ||
1257 value == LAUNCH_REGULAR || 1260 value == LAUNCH_REGULAR ||
1258 value == LAUNCH_FULLSCREEN || 1261 value == LAUNCH_FULLSCREEN ||
1259 value == LAUNCH_WINDOW)) { 1262 value == LAUNCH_WINDOW)) {
1260 result = static_cast<LaunchType>(value); 1263 result = static_cast<LaunchType>(value);
1261 } else { 1264 } else {
1262 result = default_pref_value; 1265 result = default_pref_value;
1263 } 1266 }
1264 #if defined(OS_MACOSX) 1267 #if (USE_ASH)
1268 if (ash::Shell::IsForcedMaximizeMode() &&
1269 (result == LAUNCH_FULLSCREEN || result == LAUNCH_WINDOW))
1270 result = LAUNCH_REGULAR;
1271 #endif
1272 #if defined(OS_MACOSX)
1265 // App windows are not yet supported on mac. Pref sync could make 1273 // App windows are not yet supported on mac. Pref sync could make
1266 // the launch type LAUNCH_WINDOW, even if there is no UI to set it 1274 // the launch type LAUNCH_WINDOW, even if there is no UI to set it
1267 // on mac. 1275 // on mac.
1268 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) 1276 if (!extension->is_platform_app() && result == LAUNCH_WINDOW)
1269 result = LAUNCH_REGULAR; 1277 result = LAUNCH_REGULAR;
1270 #endif 1278 #endif
1271 1279
1272 #if defined(OS_WIN) 1280 #if defined(OS_WIN)
1273 // We don't support app windows in Windows 8 single window Metro mode. 1281 // We don't support app windows in Windows 8 single window Metro mode.
1274 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW) 1282 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW)
1275 result = LAUNCH_REGULAR; 1283 result = LAUNCH_REGULAR;
1276 #endif // OS_WIN 1284 #endif // OS_WIN
1277 1285
1278 return result; 1286 return result;
1279 } 1287 }
1280 1288
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 is_enabled = initial_state == Extension::ENABLED; 2253 is_enabled = initial_state == Extension::ENABLED;
2246 } 2254 }
2247 2255
2248 extension_pref_value_map_->RegisterExtension(extension_id, install_time, 2256 extension_pref_value_map_->RegisterExtension(extension_id, install_time,
2249 is_enabled); 2257 is_enabled);
2250 content_settings_store_->RegisterExtension(extension_id, install_time, 2258 content_settings_store_->RegisterExtension(extension_id, install_time,
2251 is_enabled); 2259 is_enabled);
2252 } 2260 }
2253 2261
2254 } // namespace extensions 2262 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698