| Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| index 624c3f5eab685a3b49e76fa55b08ef5e57b6c544..81607cc96669f5495830ce955dcdafd967192837 100644
|
| --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| @@ -100,6 +100,10 @@
|
| #include "ui/resources/grit/ui_resources.h"
|
| #include "ui/wm/core/window_animations.h"
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +#include "chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h"
|
| +#endif
|
| +
|
| using extensions::Extension;
|
| using extensions::UnloadedExtensionInfo;
|
| using extension_misc::kGmailAppId;
|
| @@ -877,9 +881,20 @@ void ChromeLauncherControllerImpl::OnShelfCreated(ash::WmShelf* shelf) {
|
|
|
| if (ash::ShelfWidget::ShelfAlignmentAllowed())
|
| shelf->SetAlignment(ash::launcher::GetShelfAlignmentPref(prefs, display));
|
| +#if defined(OS_CHROMEOS)
|
| + stylus_metrics_recorder_ =
|
| + base::MakeUnique<chromeos::StylusMetricsRecorder>();
|
| +#endif
|
| }
|
|
|
| -void ChromeLauncherControllerImpl::OnShelfDestroyed(ash::WmShelf* shelf) {}
|
| +void ChromeLauncherControllerImpl::OnShelfDestroyed(ash::WmShelf* shelf) {
|
| +#if defined(OS_CHROMEOS)
|
| + // To clean up stylus_metrics_recorder_ properly, a valid shell instance is
|
| + // required. So explicityly delete it before the shell instance becomes
|
| + // invalid.
|
| + stylus_metrics_recorder_.reset();
|
| +#endif
|
| +}
|
|
|
| void ChromeLauncherControllerImpl::OnShelfAlignmentChanged(
|
| ash::WmShelf* shelf) {
|
|
|