| OLD | NEW |
| 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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "base/prefs/scoped_user_pref_update.h" | 6 #include "base/prefs/scoped_user_pref_update.h" |
| 7 #include "chrome/browser/ui/app_list/app_list_prefs.h" | 7 #include "chrome/browser/ui/app_list/app_list_prefs.h" |
| 8 #include "chrome/browser/ui/app_list/app_list_prefs_factory.h" | 8 #include "chrome/browser/ui/app_list/app_list_prefs_factory.h" |
| 9 #include "components/pref_registry/pref_registry_syncable.h" | 9 #include "components/pref_registry/pref_registry_syncable.h" |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 AppListPrefs::AppListPrefs(PrefService* pref_service) | 66 AppListPrefs::AppListPrefs(PrefService* pref_service) |
| 67 : pref_service_(pref_service) { | 67 : pref_service_(pref_service) { |
| 68 } | 68 } |
| 69 | 69 |
| 70 AppListPrefs::~AppListPrefs() { | 70 AppListPrefs::~AppListPrefs() { |
| 71 } | 71 } |
| 72 | 72 |
| 73 // static | 73 // static |
| 74 void AppListPrefs::RegisterProfilePrefs( | 74 void AppListPrefs::RegisterProfilePrefs( |
| 75 user_prefs::PrefRegistrySyncable* registry) { | 75 user_prefs::PrefRegistrySyncable* registry) { |
| 76 registry->RegisterDictionaryPref( | 76 registry->RegisterDictionaryPref(kPrefModel); |
| 77 kPrefModel, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 78 } | 77 } |
| 79 | 78 |
| 80 // static | 79 // static |
| 81 AppListPrefs* AppListPrefs::Create(PrefService* pref_service) { | 80 AppListPrefs* AppListPrefs::Create(PrefService* pref_service) { |
| 82 return new AppListPrefs(pref_service); | 81 return new AppListPrefs(pref_service); |
| 83 } | 82 } |
| 84 | 83 |
| 85 // static | 84 // static |
| 86 AppListPrefs* AppListPrefs::Get(content::BrowserContext* context) { | 85 AppListPrefs* AppListPrefs::Get(content::BrowserContext* context) { |
| 87 return AppListPrefsFactory::GetInstance()->GetForBrowserContext(context); | 86 return AppListPrefsFactory::GetInstance()->GetForBrowserContext(context); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 (*out)[it.key()] = *AppListInfo::CreateAppListInfoFromDict(item_dict); | 118 (*out)[it.key()] = *AppListInfo::CreateAppListInfoFromDict(item_dict); |
| 120 } | 119 } |
| 121 } | 120 } |
| 122 | 121 |
| 123 void AppListPrefs::DeleteAppListInfo(const std::string& id) { | 122 void AppListPrefs::DeleteAppListInfo(const std::string& id) { |
| 124 DictionaryPrefUpdate model_dict(pref_service_, kPrefModel); | 123 DictionaryPrefUpdate model_dict(pref_service_, kPrefModel); |
| 125 model_dict->Remove(id, NULL); | 124 model_dict->Remove(id, NULL); |
| 126 } | 125 } |
| 127 | 126 |
| 128 } // namespace app_list | 127 } // namespace app_list |
| OLD | NEW |