| 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..c28e677f3138b2bb8bf6c9b669e792b5e8e2df0b 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,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);
|
| + }
|
| +
|
| if (highlight_view_) {
|
| highlight_view_->SetHighlight(false);
|
| highlight_view_->SetRightIconVisible(false);
|
| @@ -68,10 +82,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);
|
| + }
|
| + } else {
|
| delegate()->EnableTool(GetToolId());
|
| + }
|
| }
|
|
|
| views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) {
|
|
|