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

Unified Diff: ash/common/system/chromeos/palette/palette_ids.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
« no previous file with comments | « ash/common/system/chromeos/palette/palette_ids.h ('k') | ash/common/system/chromeos/palette/palette_tool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/palette/palette_ids.cc
diff --git a/ash/common/system/chromeos/palette/palette_ids.cc b/ash/common/system/chromeos/palette/palette_ids.cc
index 5d5f48510d7e1d758636f06c617f00010fd182ff..fee896dd46623de0346d10e91e57bfdaa85f1917 100644
--- a/ash/common/system/chromeos/palette/palette_ids.cc
+++ b/ash/common/system/chromeos/palette/palette_ids.cc
@@ -39,4 +39,38 @@ std::string PaletteGroupToString(PaletteGroup group) {
return std::string();
}
+PaletteTrayOptions PaletteToolIdToPaletteTrayOptions(PaletteToolId tool_id) {
+ switch (tool_id) {
+ case PaletteToolId::NONE:
+ return PALETTE_OPTIONS_COUNT;
+ case PaletteToolId::CREATE_NOTE:
+ return PALETTE_NEW_NOTE;
+ case PaletteToolId::CAPTURE_REGION:
+ return PALETTE_CAPTURE_REGION;
+ case PaletteToolId::CAPTURE_SCREEN:
+ return PALETTE_CAPTURE_SCREEN;
+ case PaletteToolId::LASER_POINTER:
+ return PALETTE_LASER_POINTER;
+ case PaletteToolId::MAGNIFY:
+ return PALETTE_MAGNIFY;
+ }
+
+ NOTREACHED();
+ return PALETTE_OPTIONS_COUNT;
+}
+
+PaletteModeCancelType PaletteToolIdToPaletteModeCancelType(
+ PaletteToolId tool_id,
+ bool is_switched) {
+ PaletteModeCancelType type = PALETTE_MODE_CANCEL_TYPE_COUNT;
+ if (tool_id == PaletteToolId::LASER_POINTER) {
+ return is_switched ? PALETTE_MODE_LASER_POINTER_SWITCHED
+ : PALETTE_MODE_LASER_POINTER_CANCELLED;
+ } else if (tool_id == PaletteToolId::MAGNIFY) {
+ return is_switched ? PALETTE_MODE_MAGNIFY_SWITCHED
+ : PALETTE_MODE_MAGNIFY_CANCELLED;
+ }
+ return type;
+}
+
} // namespace ash
« no previous file with comments | « ash/common/system/chromeos/palette/palette_ids.h ('k') | ash/common/system/chromeos/palette/palette_tool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698