| OLD | NEW |
| 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/ui/ash/chrome_launcher_prefs.h" | 5 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> |
| 10 |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/values.h" | 12 #include "base/values.h" |
| 12 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
| 13 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 14 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 // App ID of default pinned apps. | 19 // App ID of default pinned apps. |
| 19 const char* kDefaultPinnedApps[] = { | 20 const char* kDefaultPinnedApps[] = { |
| 20 extension_misc::kGmailAppId, | 21 extension_misc::kGmailAppId, |
| 21 extension_misc::kGoogleDocAppId, | 22 extension_misc::kGoogleDocAppId, |
| 22 extension_misc::kYoutubeAppId, | 23 extension_misc::kYoutubeAppId, |
| 23 }; | 24 }; |
| 24 | 25 |
| 25 base::ListValue* CreateDefaultPinnedAppsList() { | 26 base::ListValue* CreateDefaultPinnedAppsList() { |
| 26 scoped_ptr<base::ListValue> apps(new base::ListValue); | 27 std::unique_ptr<base::ListValue> apps(new base::ListValue); |
| 27 for (size_t i = 0; i < arraysize(kDefaultPinnedApps); ++i) | 28 for (size_t i = 0; i < arraysize(kDefaultPinnedApps); ++i) |
| 28 apps->Append(ash::CreateAppDict(kDefaultPinnedApps[i])); | 29 apps->Append(ash::CreateAppDict(kDefaultPinnedApps[i])); |
| 29 | 30 |
| 30 return apps.release(); | 31 return apps.release(); |
| 31 } | 32 } |
| 32 | 33 |
| 33 } // namespace | 34 } // namespace |
| 34 | 35 |
| 35 namespace ash { | 36 namespace ash { |
| 36 | 37 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 64 registry->RegisterStringPref(prefs::kShelfAlignment, | 65 registry->RegisterStringPref(prefs::kShelfAlignment, |
| 65 kShelfAlignmentBottom, | 66 kShelfAlignmentBottom, |
| 66 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 67 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 67 registry->RegisterStringPref(prefs::kShelfAlignmentLocal, std::string()); | 68 registry->RegisterStringPref(prefs::kShelfAlignmentLocal, std::string()); |
| 68 registry->RegisterDictionaryPref(prefs::kShelfPreferences); | 69 registry->RegisterDictionaryPref(prefs::kShelfPreferences); |
| 69 registry->RegisterIntegerPref(prefs::kLogoutDialogDurationMs, 20000); | 70 registry->RegisterIntegerPref(prefs::kLogoutDialogDurationMs, 20000); |
| 70 registry->RegisterBooleanPref(prefs::kShowLogoutButtonInTray, false); | 71 registry->RegisterBooleanPref(prefs::kShowLogoutButtonInTray, false); |
| 71 } | 72 } |
| 72 | 73 |
| 73 base::DictionaryValue* CreateAppDict(const std::string& app_id) { | 74 base::DictionaryValue* CreateAppDict(const std::string& app_id) { |
| 74 scoped_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); | 75 std::unique_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); |
| 75 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); | 76 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); |
| 76 return app_value.release(); | 77 return app_value.release(); |
| 77 } | 78 } |
| 78 | 79 |
| 79 } // namespace ash | 80 } // namespace ash |
| OLD | NEW |