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

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: A few self nits Created 7 years, 8 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 16 matching lines...) Expand all
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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 1190
1188 if (ReadExtensionPrefInteger(extension->id(), kPrefLaunchType, &value) && 1191 if (ReadExtensionPrefInteger(extension->id(), kPrefLaunchType, &value) &&
1189 (value == LAUNCH_PINNED || 1192 (value == LAUNCH_PINNED ||
1190 value == LAUNCH_REGULAR || 1193 value == LAUNCH_REGULAR ||
1191 value == LAUNCH_FULLSCREEN || 1194 value == LAUNCH_FULLSCREEN ||
1192 value == LAUNCH_WINDOW)) { 1195 value == LAUNCH_WINDOW)) {
1193 result = static_cast<LaunchType>(value); 1196 result = static_cast<LaunchType>(value);
1194 } else { 1197 } else {
1195 result = default_pref_value; 1198 result = default_pref_value;
1196 } 1199 }
1197 #if defined(OS_MACOSX) 1200 #if (USE_ASH)
1201 if (ash::Shell::IsForcedMaximizeMode() &&
1202 (result == LAUNCH_FULLSCREEN || result == LAUNCH_WINDOW))
1203 result = LAUNCH_REGULAR;
1204 #endif
1205 #if defined(OS_MACOSX)
1198 // App windows are not yet supported on mac. Pref sync could make 1206 // App windows are not yet supported on mac. Pref sync could make
1199 // the launch type LAUNCH_WINDOW, even if there is no UI to set it 1207 // the launch type LAUNCH_WINDOW, even if there is no UI to set it
1200 // on mac. 1208 // on mac.
1201 if (!extension->is_platform_app() && result == LAUNCH_WINDOW) 1209 if (!extension->is_platform_app() && result == LAUNCH_WINDOW)
1202 result = LAUNCH_REGULAR; 1210 result = LAUNCH_REGULAR;
1203 #endif 1211 #endif
1204 1212
1205 #if defined(OS_WIN) 1213 #if defined(OS_WIN)
1206 // We don't support app windows in Windows 8 single window Metro mode. 1214 // We don't support app windows in Windows 8 single window Metro mode.
1207 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW) 1215 if (win8::IsSingleWindowMetroMode() && result == LAUNCH_WINDOW)
1208 result = LAUNCH_REGULAR; 1216 result = LAUNCH_REGULAR;
1209 #endif // OS_WIN 1217 #endif // OS_WIN
1210 1218
1211 return result; 1219 return result;
1212 } 1220 }
1213 1221
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 is_enabled = initial_state == Extension::ENABLED; 2367 is_enabled = initial_state == Extension::ENABLED;
2360 } 2368 }
2361 2369
2362 extension_pref_value_map_->RegisterExtension(extension_id, install_time, 2370 extension_pref_value_map_->RegisterExtension(extension_id, install_time,
2363 is_enabled); 2371 is_enabled);
2364 content_settings_store_->RegisterExtension(extension_id, install_time, 2372 content_settings_store_->RegisterExtension(extension_id, install_time,
2365 is_enabled); 2373 is_enabled);
2366 } 2374 }
2367 2375
2368 } // namespace extensions 2376 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698