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 <set> | 9 #include <set> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" |
12 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
13 #include "base/values.h" | 14 #include "base/values.h" |
14 #include "chrome/browser/app_mode/app_mode_utils.h" | 15 #include "chrome/browser/app_mode/app_mode_utils.h" |
15 #include "chrome/browser/chromeos/arc/arc_auth_service.h" | 16 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
16 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 17 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
17 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 18 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
18 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 19 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
19 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 20 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
20 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 21 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
21 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" | 22 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 std::string()); | 303 std::string()); |
303 registry->RegisterStringPref(prefs::kShelfAlignment, | 304 registry->RegisterStringPref(prefs::kShelfAlignment, |
304 kShelfAlignmentBottom, | 305 kShelfAlignmentBottom, |
305 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 306 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
306 registry->RegisterStringPref(prefs::kShelfAlignmentLocal, std::string()); | 307 registry->RegisterStringPref(prefs::kShelfAlignmentLocal, std::string()); |
307 registry->RegisterDictionaryPref(prefs::kShelfPreferences); | 308 registry->RegisterDictionaryPref(prefs::kShelfPreferences); |
308 registry->RegisterIntegerPref(prefs::kLogoutDialogDurationMs, 20000); | 309 registry->RegisterIntegerPref(prefs::kLogoutDialogDurationMs, 20000); |
309 registry->RegisterBooleanPref(prefs::kShowLogoutButtonInTray, false); | 310 registry->RegisterBooleanPref(prefs::kShowLogoutButtonInTray, false); |
310 } | 311 } |
311 | 312 |
312 base::DictionaryValue* CreateAppDict(const std::string& app_id) { | 313 std::unique_ptr<base::DictionaryValue> CreateAppDict( |
313 std::unique_ptr<base::DictionaryValue> app_value(new base::DictionaryValue); | 314 const std::string& app_id) { |
| 315 auto app_value = base::MakeUnique<base::DictionaryValue>(); |
314 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); | 316 app_value->SetString(kPinnedAppsPrefAppIDPath, app_id); |
315 return app_value.release(); | 317 return app_value; |
316 } | 318 } |
317 | 319 |
318 ShelfAutoHideBehavior GetShelfAutoHideBehaviorPref(PrefService* prefs, | 320 ShelfAutoHideBehavior GetShelfAutoHideBehaviorPref(PrefService* prefs, |
319 int64_t display_id) { | 321 int64_t display_id) { |
320 DCHECK_NE(display_id, display::Display::kInvalidDisplayID); | 322 DCHECK_NE(display_id, display::Display::kInvalidDisplayID); |
321 | 323 |
322 // Don't show the shelf in app mode. | 324 // Don't show the shelf in app mode. |
323 if (chrome::IsRunningInAppMode()) | 325 if (chrome::IsRunningInAppMode()) |
324 return SHELF_AUTO_HIDE_ALWAYS_HIDDEN; | 326 return SHELF_AUTO_HIDE_ALWAYS_HIDDEN; |
325 | 327 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 pin_position = position_before.CreateAfter(); | 705 pin_position = position_before.CreateAfter(); |
704 else if (position_after.IsValid()) | 706 else if (position_after.IsValid()) |
705 pin_position = position_after.CreateBefore(); | 707 pin_position = position_after.CreateBefore(); |
706 else | 708 else |
707 pin_position = syncer::StringOrdinal::CreateInitialOrdinal(); | 709 pin_position = syncer::StringOrdinal::CreateInitialOrdinal(); |
708 app_service->SetPinPosition(app_id, pin_position); | 710 app_service->SetPinPosition(app_id, pin_position); |
709 } | 711 } |
710 | 712 |
711 } // namespace launcher | 713 } // namespace launcher |
712 } // namespace ash | 714 } // namespace ash |
OLD | NEW |