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

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

Issue 2922633002: [Bookmark Apps] Make 'Open as window' checkbox checked by default. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/launch_util.h" 5 #include "chrome/browser/extensions/launch_util.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/extensions/extension_sync_service.h" 9 #include "chrome/browser/extensions/extension_sync_service.h"
10 #include "chrome/browser/extensions/extension_util.h" 10 #include "chrome/browser/extensions/extension_util.h"
(...skipping 17 matching lines...) Expand all
28 // used for apps. 28 // used for apps.
29 const char kPrefLaunchType[] = "launchType"; 29 const char kPrefLaunchType[] = "launchType";
30 30
31 } // namespace 31 } // namespace
32 32
33 namespace launch_util { 33 namespace launch_util {
34 34
35 // static 35 // static
36 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 36 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
37 registry->RegisterIntegerPref(pref_names::kBookmarkAppCreationLaunchType, 37 registry->RegisterIntegerPref(pref_names::kBookmarkAppCreationLaunchType,
38 LAUNCH_TYPE_REGULAR); 38 LAUNCH_TYPE_WINDOW);
39 } 39 }
40 40
41 } // namespace launch_util 41 } // namespace launch_util
42 42
43 LaunchType GetLaunchType(const ExtensionPrefs* prefs, 43 LaunchType GetLaunchType(const ExtensionPrefs* prefs,
44 const Extension* extension) { 44 const Extension* extension) {
45 LaunchType result = LAUNCH_TYPE_DEFAULT; 45 LaunchType result = LAUNCH_TYPE_DEFAULT;
46 46
47 int value = GetLaunchTypePrefValue(prefs, extension->id()); 47 int value = GetLaunchTypePrefValue(prefs, extension->id());
48 if (value >= LAUNCH_TYPE_FIRST && value < NUM_LAUNCH_TYPES) 48 if (value >= LAUNCH_TYPE_FIRST && value < NUM_LAUNCH_TYPES)
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 prefs->ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value); 154 prefs->ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value);
155 } 155 }
156 156
157 bool LaunchesInWindow(content::BrowserContext* context, 157 bool LaunchesInWindow(content::BrowserContext* context,
158 const Extension* extension) { 158 const Extension* extension) {
159 return GetLaunchType(ExtensionPrefs::Get(context), extension) == 159 return GetLaunchType(ExtensionPrefs::Get(context), extension) ==
160 LAUNCH_TYPE_WINDOW; 160 LAUNCH_TYPE_WINDOW;
161 } 161 }
162 162
163 } // namespace extensions 163 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698