Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 870 | 870 |
| 871 void ChromeLauncherControllerImpl::OnShelfCreated(ash::WmShelf* shelf) { | 871 void ChromeLauncherControllerImpl::OnShelfCreated(ash::WmShelf* shelf) { |
| 872 PrefService* prefs = profile_->GetPrefs(); | 872 PrefService* prefs = profile_->GetPrefs(); |
| 873 const int64_t display = GetDisplayIDForShelf(shelf); | 873 const int64_t display = GetDisplayIDForShelf(shelf); |
| 874 | 874 |
| 875 shelf->SetAutoHideBehavior( | 875 shelf->SetAutoHideBehavior( |
| 876 ash::launcher::GetShelfAutoHideBehaviorPref(prefs, display)); | 876 ash::launcher::GetShelfAutoHideBehaviorPref(prefs, display)); |
| 877 | 877 |
| 878 if (ash::ShelfWidget::ShelfAlignmentAllowed()) | 878 if (ash::ShelfWidget::ShelfAlignmentAllowed()) |
| 879 shelf->SetAlignment(ash::launcher::GetShelfAlignmentPref(prefs, display)); | 879 shelf->SetAlignment(ash::launcher::GetShelfAlignmentPref(prefs, display)); |
| 880 #if defined(OS_CHROMEOS) | |
| 881 stylus_metrics_recorder_.reset(new chromeos::StylusMetricsRecorder()); | |
|
sky
2016/09/13 00:03:25
Use MakeUnique (search for examples in code if not
xiaoyinh(OOO Sep 11-29)
2016/09/16 18:41:15
Done.
| |
| 882 #endif | |
| 880 } | 883 } |
| 881 | 884 |
| 882 void ChromeLauncherControllerImpl::OnShelfDestroyed(ash::WmShelf* shelf) {} | 885 void ChromeLauncherControllerImpl::OnShelfDestroyed(ash::WmShelf* shelf) { |
| 886 #if defined(OS_CHROMEOS) | |
|
sky
2016/09/13 00:03:25
Please document why this needs to be explicitly de
xiaoyinh(OOO Sep 11-29)
2016/09/16 18:41:15
Done.
| |
| 887 stylus_metrics_recorder_.reset(); | |
| 888 #endif | |
| 889 } | |
| 883 | 890 |
| 884 void ChromeLauncherControllerImpl::OnShelfAlignmentChanged( | 891 void ChromeLauncherControllerImpl::OnShelfAlignmentChanged( |
| 885 ash::WmShelf* shelf) { | 892 ash::WmShelf* shelf) { |
| 886 ash::launcher::SetShelfAlignmentPref( | 893 ash::launcher::SetShelfAlignmentPref( |
| 887 profile_->GetPrefs(), GetDisplayIDForShelf(shelf), shelf->alignment()); | 894 profile_->GetPrefs(), GetDisplayIDForShelf(shelf), shelf->alignment()); |
| 888 } | 895 } |
| 889 | 896 |
| 890 void ChromeLauncherControllerImpl::OnShelfAutoHideBehaviorChanged( | 897 void ChromeLauncherControllerImpl::OnShelfAutoHideBehaviorChanged( |
| 891 ash::WmShelf* shelf) { | 898 ash::WmShelf* shelf) { |
| 892 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), | 899 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1711 if (index == -1) | 1718 if (index == -1) |
| 1712 continue; | 1719 continue; |
| 1713 ash::ShelfItem item = model_->items()[index]; | 1720 ash::ShelfItem item = model_->items()[index]; |
| 1714 item.image = image; | 1721 item.image = image; |
| 1715 if (arc_deferred_launcher_) | 1722 if (arc_deferred_launcher_) |
| 1716 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); | 1723 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); |
| 1717 model_->Set(index, item); | 1724 model_->Set(index, item); |
| 1718 // It's possible we're waiting on more than one item, so don't break. | 1725 // It's possible we're waiting on more than one item, so don't break. |
| 1719 } | 1726 } |
| 1720 } | 1727 } |
| OLD | NEW |