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_ = | |
| 882 base::MakeUnique<chromeos::StylusMetricsRecorder>(); | |
| 883 #endif | |
| 880 } | 884 } |
| 881 | 885 |
| 882 void ChromeLauncherControllerImpl::OnShelfDestroyed(ash::WmShelf* shelf) {} | 886 void ChromeLauncherControllerImpl::OnShelfDestroyed(ash::WmShelf* shelf) { |
| 887 // To clean up stylus_metrics_recorder_ properly, a valid shell instance is | |
| 888 // required. So explicityly delete it before the shell instance becomes invalid. | |
|
xiyuan
2016/09/16 20:07:54
nit: wrong indent. Comment should use the same ind
xiaoyinh(OOO Sep 11-29)
2016/09/16 22:34:25
Done.
| |
| 889 #if defined(OS_CHROMEOS) | |
|
xiyuan
2016/09/16 20:07:54
nit: move this above the comment to keep it closer
xiaoyinh(OOO Sep 11-29)
2016/09/16 22:34:25
Done.
| |
| 890 stylus_metrics_recorder_.reset(); | |
| 891 #endif | |
| 892 } | |
| 883 | 893 |
| 884 void ChromeLauncherControllerImpl::OnShelfAlignmentChanged( | 894 void ChromeLauncherControllerImpl::OnShelfAlignmentChanged( |
| 885 ash::WmShelf* shelf) { | 895 ash::WmShelf* shelf) { |
| 886 ash::launcher::SetShelfAlignmentPref( | 896 ash::launcher::SetShelfAlignmentPref( |
| 887 profile_->GetPrefs(), GetDisplayIDForShelf(shelf), shelf->alignment()); | 897 profile_->GetPrefs(), GetDisplayIDForShelf(shelf), shelf->alignment()); |
| 888 } | 898 } |
| 889 | 899 |
| 890 void ChromeLauncherControllerImpl::OnShelfAutoHideBehaviorChanged( | 900 void ChromeLauncherControllerImpl::OnShelfAutoHideBehaviorChanged( |
| 891 ash::WmShelf* shelf) { | 901 ash::WmShelf* shelf) { |
| 892 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), | 902 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1711 if (index == -1) | 1721 if (index == -1) |
| 1712 continue; | 1722 continue; |
| 1713 ash::ShelfItem item = model_->items()[index]; | 1723 ash::ShelfItem item = model_->items()[index]; |
| 1714 item.image = image; | 1724 item.image = image; |
| 1715 if (arc_deferred_launcher_) | 1725 if (arc_deferred_launcher_) |
| 1716 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); | 1726 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); |
| 1717 model_->Set(index, item); | 1727 model_->Set(index, item); |
| 1718 // It's possible we're waiting on more than one item, so don't break. | 1728 // It's possible we're waiting on more than one item, so don't break. |
| 1719 } | 1729 } |
| 1720 } | 1730 } |
| OLD | NEW |