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) |