Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1657)

Unified Diff: ash/common/system/chromeos/palette/common_palette_tool.cc

Issue 2308823002: Add UMA stats for pen palette (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9f8faf4c71dc6f65c38b75c9cdbe360a63780529..86e443c549e8f14a3f3116798e4f3ee4d6df8cf9 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"
@@ -52,6 +53,7 @@ void CommonPaletteTool::OnViewDestroyed() {
void CommonPaletteTool::OnEnable() {
PaletteTool::OnEnable();
+ start_time_ = base::TimeTicks::Now();
if (highlight_view_) {
highlight_view_->SetHighlight(true);
@@ -62,6 +64,18 @@ void CommonPaletteTool::OnEnable() {
void CommonPaletteTool::OnDisable() {
PaletteTool::OnDisable();
+ if (GetToolId() == PaletteToolId::LASER_POINTER) {
+ UMA_HISTOGRAM_CUSTOM_TIMES("Ash.Shelf.Palette.InLaserPointerMode",
+ base::TimeTicks::Now() - start_time_,
+ base::TimeDelta::FromMilliseconds(100),
+ base::TimeDelta::FromHours(1), 50);
+ } else if (GetToolId() == PaletteToolId::MAGNIFY) {
+ UMA_HISTOGRAM_CUSTOM_TIMES("Ash.Shelf.Palette.InMagnifyMode",
+ base::TimeTicks::Now() - start_time_,
+ base::TimeDelta::FromMilliseconds(100),
+ base::TimeDelta::FromHours(1), 50);
+ }
stevenjb 2016/09/13 16:32:18 Do we anticipate adding more tools? If so I would
xiaoyinh(OOO Sep 11-29) 2016/09/14 00:51:24 Done.
+
if (highlight_view_) {
highlight_view_->SetHighlight(false);
highlight_view_->SetRightIconVisible(false);
@@ -69,10 +83,20 @@ void CommonPaletteTool::OnDisable() {
}
void CommonPaletteTool::OnViewClicked(views::View* sender) {
- if (enabled())
+ delegate()->RecordPaletteOptionsUsage(
+ PaletteToolIdToPaletteTrayOptions(GetToolId()));
+ if (enabled()) {
delegate()->DisableTool(GetToolId());
- else
+ if (GetToolId() == PaletteToolId::LASER_POINTER) {
+ delegate()->RecordPaletteModeCancellation(
+ PaletteModeCancelType::PALETTE_MODE_LASER_POINTER_CANCELLED);
+ } else if (GetToolId() == PaletteToolId::MAGNIFY) {
+ delegate()->RecordPaletteModeCancellation(
+ PaletteModeCancelType::PALETTE_MODE_MAGNIFY_CANCELLED);
+ }
stevenjb 2016/09/13 16:32:18 same here.
xiaoyinh(OOO Sep 11-29) 2016/09/14 00:51:24 Done.
+ } else {
delegate()->EnableTool(GetToolId());
+ }
}
views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) {

Powered by Google App Engine
This is Rietveld 408576698