| 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 f06900a16b276b98dab8da7be05dee965da99858..34491fdce6b4ed8210f6f826caa3116d160d7f7e 100644
|
| --- a/ash/common/system/chromeos/palette/palette_tool_manager.cc
|
| +++ b/ash/common/system/chromeos/palette/palette_tool_manager.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "ash/common/system/chromeos/palette/palette_tool.h"
|
| #include "base/bind.h"
|
| +#include "base/metrics/histogram_macros.h"
|
| #include "ui/gfx/vector_icons_public.h"
|
|
|
| namespace ash {
|
| @@ -38,8 +39,16 @@ void PaletteToolManager::ActivateTool(PaletteToolId tool_id) {
|
| if (new_tool == previous_tool)
|
| return;
|
|
|
| - if (previous_tool)
|
| + if (previous_tool) {
|
| previous_tool->OnDisable();
|
| + if (previous_tool->GetToolId() == PaletteToolId::LASER_POINTER) {
|
| + RecordPaletteModeCancellation(
|
| + PaletteModeCancelType::PALETTE_MODE_LASER_POINTER_SWITCHED);
|
| + } else if (previous_tool->GetToolId() == PaletteToolId::MAGNIFY) {
|
| + RecordPaletteModeCancellation(
|
| + PaletteModeCancelType::PALETTE_MODE_MAGNIFY_SWITCHED);
|
| + }
|
| + }
|
|
|
| active_tools_[new_tool->GetGroup()] = new_tool;
|
| new_tool->OnEnable();
|
| @@ -117,6 +126,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) {
|
| for (std::unique_ptr<PaletteTool>& tool : tools_) {
|
| if (tool->GetToolId() == tool_id)
|
|
|