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

Unified Diff: ui/wm/public/text_edit_command_x11.cc

Issue 213283004: linux_aura: Port GtkKeybindingsHandler to Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Abort attempts to rewrite unit tests due to linking issues. Created 6 years, 9 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
Index: ui/wm/public/text_edit_command_x11.cc
diff --git a/ui/wm/public/text_edit_command_x11.cc b/ui/wm/public/text_edit_command_x11.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a59b28ad12ad4caf43c89c24fce33b7d04834f89
--- /dev/null
+++ b/ui/wm/public/text_edit_command_x11.cc
@@ -0,0 +1,127 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/wm/public/text_edit_command_x11.h"
+
+#include "base/logging.h"
+
+namespace ui {
+namespace wm {
+
+std::string TextEditCommandX11::GetCommandString() const {
+ std::string base_name;
+ switch (command_id_) {
+ case COPY:
+ base_name = "Copy";
+ break;
+ case CUT:
+ base_name = "Cut";
+ break;
+ case DELETE_BACKWARD:
+ base_name = "DeleteBackward";
+ break;
+ case DELETE_FORWARD:
+ base_name = "DeleteForward";
+ break;
+ case DELETE_TO_BEGINING_OF_LINE:
+ base_name = "DeleteToBeginningOfLine";
+ break;
+ case DELETE_TO_BEGINING_OF_PARAGRAPH:
+ base_name = "DeleteToBeginningOfParagraph";
+ break;
+ case DELETE_TO_END_OF_LINE:
+ base_name = "DeleteToEndOfLine";
+ break;
+ case DELETE_TO_END_OF_PARAGRAPH:
+ base_name = "DeleteToEndOfParagraph";
+ break;
+ case DELETE_WORD_BACKWARD:
+ base_name = "DeleteWordBackward";
+ break;
+ case DELETE_WORD_FORWARD:
+ base_name = "DeleteWordForward";
+ break;
+ case INSERT_TEXT:
+ base_name = "InsertText";
+ break;
+ case MOVE_BACKWARD:
+ base_name = "MoveBackward";
+ break;
+ case MOVE_DOWN:
+ base_name = "MoveDown";
+ break;
+ case MOVE_FORWARD:
+ base_name = "MoveForward";
+ break;
+ case MOVE_LEFT:
+ base_name = "MoveLeft";
+ break;
+ case MOVE_PAGE_DOWN:
+ base_name = "MovePageDown";
+ break;
+ case MOVE_PAGE_UP:
+ base_name = "MovePageUp";
+ break;
+ case MOVE_RIGHT:
+ base_name = "MoveRight";
+ break;
+ case MOVE_TO_BEGINING_OF_DOCUMENT:
+ base_name = "MoveToBeginningOfDocument";
+ break;
+ case MOVE_TO_BEGINING_OF_LINE:
+ base_name = "MoveToBeginningOfLine";
+ break;
+ case MOVE_TO_BEGINING_OF_PARAGRAPH:
+ base_name = "MoveToBeginningOfParagraph";
+ break;
+ case MOVE_TO_END_OF_DOCUMENT:
+ base_name = "MoveToEndOfDocument";
+ break;
+ case MOVE_TO_END_OF_LINE:
+ base_name = "MoveToEndOfLine";
+ break;
+ case MOVE_TO_END_OF_PARAGRAPH:
+ base_name = "MoveToEndOfParagraph";
+ break;
+ case MOVE_UP:
+ base_name = "MoveUp";
+ break;
+ case MOVE_WORD_BACKWARD:
+ base_name = "MoveWordBackward";
+ break;
+ case MOVE_WORD_FORWARD:
+ base_name = "MoveWordForward";
+ break;
+ case MOVE_WORD_LEFT:
+ base_name = "MoveWordLeft";
+ break;
+ case MOVE_WORD_RIGHT:
+ base_name = "MoveWordRight";
+ break;
+ case PASTE:
+ base_name = "Paste";
+ break;
+ case SELECT_ALL:
+ base_name = "SelectAll";
+ break;
+ case SET_MARK:
+ base_name = "SetMark";
+ break;
+ case UNSELECT:
+ base_name = "Unselect";
+ break;
+ default:
sky 2014/03/31 20:44:05 Can't you remove this to get a compile error if a
+ NOTREACHED();
+ return std::string();
+ }
+
+ if (extend_selection())
+ base_name += "AndModifySelection";
+
+ return base_name;
+}
+
+} // namespace wm
+} // namespace ui
+

Powered by Google App Engine
This is Rietveld 408576698