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

Unified Diff: ash/common/system/chromeos/palette/palette_tool_manager.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/palette_tool_manager.cc
diff --git a/ash/common/system/chromeos/palette/palette_tool_manager.cc b/ash/common/system/chromeos/palette/palette_tool_manager.cc
index b9a306ec2d91e4103125ffffa00a45812d153ecf..d9a79b806079e45e7820862a2219a1e5768f5ab0 100644
--- a/ash/common/system/chromeos/palette/palette_tool_manager.cc
+++ b/ash/common/system/chromeos/palette/palette_tool_manager.cc
@@ -9,6 +9,7 @@
#include "ash/common/system/chromeos/palette/palette_tool.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "base/bind.h"
+#include "base/metrics/histogram_macros.h"
namespace ash {
@@ -38,8 +39,11 @@ void PaletteToolManager::ActivateTool(PaletteToolId tool_id) {
if (new_tool == previous_tool)
return;
- if (previous_tool)
+ if (previous_tool) {
previous_tool->OnDisable();
+ RecordPaletteModeCancellation(PaletteToolIdToPaletteModeCancelType(
+ previous_tool->GetToolId(), true /*is_switched*/));
+ }
active_tools_[new_tool->GetGroup()] = new_tool;
new_tool->OnEnable();
@@ -118,6 +122,15 @@ WmWindow* PaletteToolManager::GetWindow() {
return delegate_->GetWindow();
}
+void PaletteToolManager::RecordPaletteOptionsUsage(PaletteTrayOptions option) {
+ return delegate_->RecordPaletteOptionsUsage(option);
+}
+
+void PaletteToolManager::RecordPaletteModeCancellation(
+ PaletteModeCancelType type) {
+ return delegate_->RecordPaletteModeCancellation(type);
+}
+
PaletteTool* PaletteToolManager::FindToolById(PaletteToolId tool_id) const {
for (const std::unique_ptr<PaletteTool>& tool : tools_) {
if (tool->GetToolId() == tool_id)

Powered by Google App Engine
This is Rietveld 408576698