Index: ash/common/system/chromeos/palette/common_palette_tool.cc |
diff --git a/ash/common/system/chromeos/palette/common_palette_tool.cc b/ash/common/system/chromeos/palette/common_palette_tool.cc |
index f71b87cd06e312493653ebc0cb8434476e4f0a53..344f453806536b64b8b0b1adca90a4a639e2d381 100644 |
--- a/ash/common/system/chromeos/palette/common_palette_tool.cc |
+++ b/ash/common/system/chromeos/palette/common_palette_tool.cc |
@@ -10,6 +10,7 @@ |
#include "ash/common/system/tray/hover_highlight_view.h" |
#include "ash/common/system/tray/view_click_listener.h" |
#include "base/logging.h" |
+#include "base/metrics/histogram_macros.h" |
#include "base/strings/utf_string_conversions.h" |
#include "grit/ash_resources.h" |
#include "ui/base/resource/resource_bundle.h" |
@@ -51,6 +52,7 @@ void CommonPaletteTool::OnViewDestroyed() { |
void CommonPaletteTool::OnEnable() { |
PaletteTool::OnEnable(); |
+ start_time_ = base::TimeTicks::Now(); |
if (highlight_view_) { |
highlight_view_->SetHighlight(true); |
@@ -61,6 +63,14 @@ void CommonPaletteTool::OnEnable() { |
void CommonPaletteTool::OnDisable() { |
PaletteTool::OnDisable(); |
+ if (GetToolId() == ash::PaletteToolId::LASER_POINTER) { |
jdufault
2016/09/02 21:54:30
What about something like
if (ShouldRecordUma(Get
Ilya Sherman
2016/09/02 22:02:49
Histogram names passed to UMA_HISTOGRAM_ macros mu
|
+ UMA_HISTOGRAM_LONG_TIMES_100("Ash.Shelf.Palette.InLaserPointerMode", |
Ilya Sherman
2016/09/02 21:39:30
Hmm, are values under 100 ms at all likely? I wou
xiaoyinh(OOO Sep 11-29)
2016/09/06 17:40:04
Done.
|
+ base::TimeTicks::Now() - start_time_); |
+ } else if (GetToolId() == ash::PaletteToolId::MAGNIFY) { |
+ UMA_HISTOGRAM_LONG_TIMES_100("Ash.Shelf.Palette.InMagnifyMode", |
+ base::TimeTicks::Now() - start_time_); |
+ } |
+ |
if (highlight_view_) { |
highlight_view_->SetHighlight(false); |
highlight_view_->SetRightIconVisible(false); |
@@ -68,6 +78,8 @@ void CommonPaletteTool::OnDisable() { |
} |
void CommonPaletteTool::OnViewClicked(views::View* sender) { |
+ delegate()->RecordPaletteMetrics( |
+ PaletteToolIdToPaletteTrayOptions(GetToolId())); |
if (enabled()) |
delegate()->DisableTool(GetToolId()); |
else |