1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ui/events/linux/text_edit_command_auralinux.h"
6
7#include "base/logging.h"
8
9namespace ui {
10
11std::string TextEditCommandAuraLinux::GetCommandString() const {
12  std::string base_name;
13  switch (command_id_) {
14    case COPY:
15      base_name = "Copy";
16      break;
17    case CUT:
18      base_name = "Cut";
19      break;
20    case DELETE_BACKWARD:
21      base_name = "DeleteBackward";
22      break;
23    case DELETE_FORWARD:
24      base_name = "DeleteForward";
25      break;
26    case DELETE_TO_BEGINING_OF_LINE:
27      base_name = "DeleteToBeginningOfLine";
28      break;
29    case DELETE_TO_BEGINING_OF_PARAGRAPH:
30      base_name = "DeleteToBeginningOfParagraph";
31      break;
32    case DELETE_TO_END_OF_LINE:
33      base_name = "DeleteToEndOfLine";
34      break;
35    case DELETE_TO_END_OF_PARAGRAPH:
36      base_name = "DeleteToEndOfParagraph";
37      break;
38    case DELETE_WORD_BACKWARD:
39      base_name = "DeleteWordBackward";
40      break;
41    case DELETE_WORD_FORWARD:
42      base_name = "DeleteWordForward";
43      break;
44    case INSERT_TEXT:
45      base_name = "InsertText";
46      break;
47    case MOVE_BACKWARD:
48      base_name = "MoveBackward";
49      break;
50    case MOVE_DOWN:
51      base_name = "MoveDown";
52      break;
53    case MOVE_FORWARD:
54      base_name = "MoveForward";
55      break;
56    case MOVE_LEFT:
57      base_name = "MoveLeft";
58      break;
59    case MOVE_PAGE_DOWN:
60      base_name = "MovePageDown";
61      break;
62    case MOVE_PAGE_UP:
63      base_name = "MovePageUp";
64      break;
65    case MOVE_RIGHT:
66      base_name = "MoveRight";
67      break;
68    case MOVE_TO_BEGINING_OF_DOCUMENT:
69      base_name = "MoveToBeginningOfDocument";
70      break;
71    case MOVE_TO_BEGINING_OF_LINE:
72      base_name = "MoveToBeginningOfLine";
73      break;
74    case MOVE_TO_BEGINING_OF_PARAGRAPH:
75      base_name = "MoveToBeginningOfParagraph";
76      break;
77    case MOVE_TO_END_OF_DOCUMENT:
78      base_name = "MoveToEndOfDocument";
79      break;
80    case MOVE_TO_END_OF_LINE:
81      base_name = "MoveToEndOfLine";
82      break;
83    case MOVE_TO_END_OF_PARAGRAPH:
84      base_name = "MoveToEndOfParagraph";
85      break;
86    case MOVE_UP:
87      base_name = "MoveUp";
88      break;
89    case MOVE_WORD_BACKWARD:
90      base_name = "MoveWordBackward";
91      break;
92    case MOVE_WORD_FORWARD:
93      base_name = "MoveWordForward";
94      break;
95    case MOVE_WORD_LEFT:
96      base_name = "MoveWordLeft";
97      break;
98    case MOVE_WORD_RIGHT:
99      base_name = "MoveWordRight";
100      break;
101    case PASTE:
102      base_name = "Paste";
103      break;
104    case SELECT_ALL:
105      base_name = "SelectAll";
106      break;
107    case SET_MARK:
108      base_name = "SetMark";
109      break;
110    case UNSELECT:
111      base_name = "Unselect";
112      break;
113    case INVALID_COMMAND:
114      NOTREACHED();
115      return std::string();
116  }
117
118  if (extend_selection())
119    base_name += "AndModifySelection";
120
121  return base_name;
122}
123
124}  // namespace ui
125