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

Side by Side Diff: ash/system/palette/palette_ids.cc

Issue 2824703006: Add MetalayerMode to the palette. (Closed)
Patch Set: Fixed copyright year Created 3 years, 8 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
« no previous file with comments | « ash/system/palette/palette_ids.h ('k') | ash/system/palette/palette_tool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/system/palette/palette_ids.h" 5 #include "ash/system/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) {
11 switch (tool_id) { 11 switch (tool_id) {
12 case PaletteToolId::NONE: 12 case PaletteToolId::NONE:
13 return "NONE"; 13 return "NONE";
14 case PaletteToolId::CREATE_NOTE: 14 case PaletteToolId::CREATE_NOTE:
15 return "CREATE_NOTE"; 15 return "CREATE_NOTE";
16 case PaletteToolId::CAPTURE_REGION: 16 case PaletteToolId::CAPTURE_REGION:
17 return "CAPTURE_REGION"; 17 return "CAPTURE_REGION";
18 case PaletteToolId::CAPTURE_SCREEN: 18 case PaletteToolId::CAPTURE_SCREEN:
19 return "CAPTURE_SCREEN"; 19 return "CAPTURE_SCREEN";
20 case PaletteToolId::LASER_POINTER: 20 case PaletteToolId::LASER_POINTER:
21 return "LASER_POINTER"; 21 return "LASER_POINTER";
22 case PaletteToolId::MAGNIFY: 22 case PaletteToolId::MAGNIFY:
23 return "MAGNIFY"; 23 return "MAGNIFY";
24 case PaletteToolId::METALAYER:
25 return "METALAYER";
24 } 26 }
25 27
26 NOTREACHED(); 28 NOTREACHED();
27 return std::string(); 29 return std::string();
28 } 30 }
29 31
30 std::string PaletteGroupToString(PaletteGroup group) { 32 std::string PaletteGroupToString(PaletteGroup group) {
31 switch (group) { 33 switch (group) {
32 case PaletteGroup::ACTION: 34 case PaletteGroup::ACTION:
33 return "ACTION"; 35 return "ACTION";
(...skipping 12 matching lines...) Expand all
46 case PaletteToolId::CREATE_NOTE: 48 case PaletteToolId::CREATE_NOTE:
47 return PALETTE_NEW_NOTE; 49 return PALETTE_NEW_NOTE;
48 case PaletteToolId::CAPTURE_REGION: 50 case PaletteToolId::CAPTURE_REGION:
49 return PALETTE_CAPTURE_REGION; 51 return PALETTE_CAPTURE_REGION;
50 case PaletteToolId::CAPTURE_SCREEN: 52 case PaletteToolId::CAPTURE_SCREEN:
51 return PALETTE_CAPTURE_SCREEN; 53 return PALETTE_CAPTURE_SCREEN;
52 case PaletteToolId::LASER_POINTER: 54 case PaletteToolId::LASER_POINTER:
53 return PALETTE_LASER_POINTER; 55 return PALETTE_LASER_POINTER;
54 case PaletteToolId::MAGNIFY: 56 case PaletteToolId::MAGNIFY:
55 return PALETTE_MAGNIFY; 57 return PALETTE_MAGNIFY;
58 case PaletteToolId::METALAYER:
59 return PALETTE_METALAYER;
56 } 60 }
57 61
58 NOTREACHED(); 62 NOTREACHED();
59 return PALETTE_OPTIONS_COUNT; 63 return PALETTE_OPTIONS_COUNT;
60 } 64 }
61 65
62 PaletteModeCancelType PaletteToolIdToPaletteModeCancelType( 66 PaletteModeCancelType PaletteToolIdToPaletteModeCancelType(
63 PaletteToolId tool_id, 67 PaletteToolId tool_id,
64 bool is_switched) { 68 bool is_switched) {
65 PaletteModeCancelType type = PALETTE_MODE_CANCEL_TYPE_COUNT; 69 PaletteModeCancelType type = PALETTE_MODE_CANCEL_TYPE_COUNT;
66 if (tool_id == PaletteToolId::LASER_POINTER) { 70 if (tool_id == PaletteToolId::LASER_POINTER) {
67 return is_switched ? PALETTE_MODE_LASER_POINTER_SWITCHED 71 return is_switched ? PALETTE_MODE_LASER_POINTER_SWITCHED
68 : PALETTE_MODE_LASER_POINTER_CANCELLED; 72 : PALETTE_MODE_LASER_POINTER_CANCELLED;
69 } else if (tool_id == PaletteToolId::MAGNIFY) { 73 } else if (tool_id == PaletteToolId::MAGNIFY) {
70 return is_switched ? PALETTE_MODE_MAGNIFY_SWITCHED 74 return is_switched ? PALETTE_MODE_MAGNIFY_SWITCHED
71 : PALETTE_MODE_MAGNIFY_CANCELLED; 75 : PALETTE_MODE_MAGNIFY_CANCELLED;
72 } 76 }
73 return type; 77 return type;
74 } 78 }
75 79
76 } // namespace ash 80 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/palette/palette_ids.h ('k') | ash/system/palette/palette_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698