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 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 auto app_value = base::MakeUnique<base::DictionaryValue>(); | 338 auto app_value = base::MakeUnique<base::DictionaryValue>(); |
339 app_value->SetString(kPinnedAppsPrefAppIDPath, app_launcher_id.ToString()); | 339 app_value->SetString(kPinnedAppsPrefAppIDPath, app_launcher_id.ToString()); |
340 return app_value; | 340 return app_value; |
341 } | 341 } |
342 | 342 |
343 ShelfAutoHideBehavior GetShelfAutoHideBehaviorPref(PrefService* prefs, | 343 ShelfAutoHideBehavior GetShelfAutoHideBehaviorPref(PrefService* prefs, |
344 int64_t display_id) { | 344 int64_t display_id) { |
345 DCHECK_NE(display_id, display::Display::kInvalidDisplayID); | 345 DCHECK_NE(display_id, display::Display::kInvalidDisplayID); |
346 | 346 |
347 // Don't show the shelf in app mode. | 347 // Don't show the shelf in app mode. |
348 if (chrome::IsRunningInAppMode()) | 348 if (chrome::IsRunningInAppMode() || chrome::IsRunningInAndroidAppMode()) |
349 return SHELF_AUTO_HIDE_ALWAYS_HIDDEN; | 349 return SHELF_AUTO_HIDE_ALWAYS_HIDDEN; |
350 | 350 |
351 // See comment in |kShelfAlignment| as to why we consider two prefs. | 351 // See comment in |kShelfAlignment| as to why we consider two prefs. |
352 return AutoHideBehaviorFromPref( | 352 return AutoHideBehaviorFromPref( |
353 GetPerDisplayPref(prefs, display_id, prefs::kShelfAutoHideBehaviorLocal, | 353 GetPerDisplayPref(prefs, display_id, prefs::kShelfAutoHideBehaviorLocal, |
354 prefs::kShelfAutoHideBehavior)); | 354 prefs::kShelfAutoHideBehavior)); |
355 } | 355 } |
356 | 356 |
357 void SetShelfAutoHideBehaviorPref(PrefService* prefs, | 357 void SetShelfAutoHideBehaviorPref(PrefService* prefs, |
358 int64_t display_id, | 358 int64_t display_id, |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 pin_position = position_before.CreateAfter(); | 739 pin_position = position_before.CreateAfter(); |
740 else if (position_after.IsValid()) | 740 else if (position_after.IsValid()) |
741 pin_position = position_after.CreateBefore(); | 741 pin_position = position_after.CreateBefore(); |
742 else | 742 else |
743 pin_position = syncer::StringOrdinal::CreateInitialOrdinal(); | 743 pin_position = syncer::StringOrdinal::CreateInitialOrdinal(); |
744 app_service->SetPinPosition(app_launcher_id_str, pin_position); | 744 app_service->SetPinPosition(app_launcher_id_str, pin_position); |
745 } | 745 } |
746 | 746 |
747 } // namespace launcher | 747 } // namespace launcher |
748 } // namespace ash | 748 } // namespace ash |
OLD | NEW |