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

Side by Side Diff: chrome/browser/apps/drive/drive_app_mapping.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, 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
« no previous file with comments | « chrome/browser/android/new_tab_page_prefs.cc ('k') | chrome/browser/apps/shortcut_manager.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/apps/drive/drive_app_mapping.h" 5 #include "chrome/browser/apps/drive/drive_app_mapping.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/prefs/scoped_user_pref_update.h" 8 #include "base/prefs/scoped_user_pref_update.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 25 matching lines...) Expand all
36 DriveAppMapping::DriveAppMapping(PrefService* prefs) : prefs_(prefs) { 36 DriveAppMapping::DriveAppMapping(PrefService* prefs) : prefs_(prefs) {
37 GetUninstalledIdsFromPref(); 37 GetUninstalledIdsFromPref();
38 } 38 }
39 39
40 DriveAppMapping::~DriveAppMapping() { 40 DriveAppMapping::~DriveAppMapping() {
41 } 41 }
42 42
43 // static 43 // static
44 void DriveAppMapping::RegisterProfilePrefs( 44 void DriveAppMapping::RegisterProfilePrefs(
45 user_prefs::PrefRegistrySyncable* registry) { 45 user_prefs::PrefRegistrySyncable* registry) {
46 registry->RegisterDictionaryPref( 46 registry->RegisterDictionaryPref(prefs::kAppLauncherDriveAppMapping);
47 prefs::kAppLauncherDriveAppMapping, 47 registry->RegisterListPref(prefs::kAppLauncherUninstalledDriveApps);
48 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
49 registry->RegisterListPref(
50 prefs::kAppLauncherUninstalledDriveApps,
51 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
52 } 48 }
53 49
54 void DriveAppMapping::Add(const std::string& drive_app_id, 50 void DriveAppMapping::Add(const std::string& drive_app_id,
55 const std::string& chrome_app_id, 51 const std::string& chrome_app_id,
56 bool generated) { 52 bool generated) {
57 DictionaryPrefUpdate update(prefs_, prefs::kAppLauncherDriveAppMapping); 53 DictionaryPrefUpdate update(prefs_, prefs::kAppLauncherDriveAppMapping);
58 update->SetWithoutPathExpansion( 54 update->SetWithoutPathExpansion(
59 drive_app_id, CreateInfoDict(chrome_app_id, generated).release()); 55 drive_app_id, CreateInfoDict(chrome_app_id, generated).release());
60 } 56 }
61 57
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 uninstalled_app_ids_.insert(app_id); 158 uninstalled_app_ids_.insert(app_id);
163 } 159 }
164 } 160 }
165 161
166 void DriveAppMapping::UpdateUninstalledList() { 162 void DriveAppMapping::UpdateUninstalledList() {
167 ListPrefUpdate update(prefs_, prefs::kAppLauncherUninstalledDriveApps); 163 ListPrefUpdate update(prefs_, prefs::kAppLauncherUninstalledDriveApps);
168 update->Clear(); 164 update->Clear();
169 for (const auto& app_id : uninstalled_app_ids_) 165 for (const auto& app_id : uninstalled_app_ids_)
170 update->AppendString(app_id); 166 update->AppendString(app_id);
171 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/android/new_tab_page_prefs.cc ('k') | chrome/browser/apps/shortcut_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698