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

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

Issue 1102733002: Remove most occurences of PrefRegistrySyncable::UNSYNCABLE_PREF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs-add-reg-funcs
Patch Set: Created 5 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
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/first_run/first_run.cc » ('j') | 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 "chrome/browser/extensions/extension_sync_service.h" 8 #include "chrome/browser/extensions/extension_sync_service.h"
9 #include "chrome/browser/extensions/extension_util.h" 9 #include "chrome/browser/extensions/extension_util.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 16 matching lines...) Expand all
27 // A preference set by the the NTP to persist the desired launch container type 27 // A preference set by the the NTP to persist the desired launch container type
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( 37 registry->RegisterIntegerPref(pref_names::kBookmarkAppCreationLaunchType,
38 pref_names::kBookmarkAppCreationLaunchType, 38 LAUNCH_TYPE_REGULAR);
39 LAUNCH_TYPE_REGULAR,
40 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
41 } 39 }
42 40
43 } // namespace launch_util 41 } // namespace launch_util
44 42
45 LaunchType GetLaunchType(const ExtensionPrefs* prefs, 43 LaunchType GetLaunchType(const ExtensionPrefs* prefs,
46 const Extension* extension) { 44 const Extension* extension) {
47 LaunchType result = LAUNCH_TYPE_DEFAULT; 45 LaunchType result = LAUNCH_TYPE_DEFAULT;
48 46
49 int value = GetLaunchTypePrefValue(prefs, extension->id()); 47 int value = GetLaunchTypePrefValue(prefs, extension->id());
50 if (value >= LAUNCH_TYPE_FIRST && value < NUM_LAUNCH_TYPES) 48 if (value >= LAUNCH_TYPE_FIRST && value < NUM_LAUNCH_TYPES)
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 bool HasPreferredLaunchContainer(const ExtensionPrefs* prefs, 138 bool HasPreferredLaunchContainer(const ExtensionPrefs* prefs,
141 const Extension* extension) { 139 const Extension* extension) {
142 int value = -1; 140 int value = -1;
143 LaunchContainer manifest_launch_container = 141 LaunchContainer manifest_launch_container =
144 AppLaunchInfo::GetLaunchContainer(extension); 142 AppLaunchInfo::GetLaunchContainer(extension);
145 return manifest_launch_container == LAUNCH_CONTAINER_TAB && 143 return manifest_launch_container == LAUNCH_CONTAINER_TAB &&
146 prefs->ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value); 144 prefs->ReadPrefAsInteger(extension->id(), kPrefLaunchType, &value);
147 } 145 }
148 146
149 } // namespace extensions 147 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/first_run/first_run.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698