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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/chromeos/palette/palette_ids.h" 5 #include "ash/common/system/chromeos/palette/palette_ids.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 namespace ash { 8 namespace ash {
9 9
10 std::string PaletteToolIdToString(PaletteToolId tool_id) { 10 std::string PaletteToolIdToString(PaletteToolId tool_id) {
(...skipping 21 matching lines...) Expand all
32 case PaletteGroup::ACTION: 32 case PaletteGroup::ACTION:
33 return "ACTION"; 33 return "ACTION";
34 case PaletteGroup::MODE: 34 case PaletteGroup::MODE:
35 return "MODE"; 35 return "MODE";
36 } 36 }
37 37
38 NOTREACHED(); 38 NOTREACHED();
39 return std::string(); 39 return std::string();
40 } 40 }
41 41
42 PaletteTrayOptions PaletteToolIdToPaletteTrayOptions(PaletteToolId tool_id) {
43 switch (tool_id) {
44 case PaletteToolId::NONE:
45 return PALETTE_OPTIONS_COUNT;
46 case PaletteToolId::CREATE_NOTE:
47 return PALETTE_NEW_NOTE;
48 case PaletteToolId::CAPTURE_REGION:
49 return PALETTE_CAPTURE_REGION;
50 case PaletteToolId::CAPTURE_SCREEN:
51 return PALETTE_CAPTURE_SCREEN;
52 case PaletteToolId::LASER_POINTER:
53 return PALETTE_LASER_POINTER;
54 case PaletteToolId::MAGNIFY:
55 return PALETTE_MAGNIFY;
56 }
57
58 NOTREACHED();
59 return PALETTE_OPTIONS_COUNT;
60 }
61
62 PaletteModeCancelType PaletteToolIdToPaletteModeCancelType(
63 PaletteToolId tool_id,
64 bool is_switched) {
65 PaletteModeCancelType type = PALETTE_MODE_CANCEL_TYPE_COUNT;
66 if (tool_id == PaletteToolId::LASER_POINTER) {
67 return is_switched ? PALETTE_MODE_LASER_POINTER_SWITCHED
68 : PALETTE_MODE_LASER_POINTER_CANCELLED;
69 } else if (tool_id == PaletteToolId::MAGNIFY) {
70 return is_switched ? PALETTE_MODE_MAGNIFY_SWITCHED
71 : PALETTE_MODE_MAGNIFY_CANCELLED;
72 }
73 return type;
74 }
75
42 } // namespace ash 76 } // namespace ash
OLDNEW
« 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