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

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 2085873002: Add test for TextEditCommandAuraLinux::GetCommandString. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor8_unify_text_edit_commands
Patch Set: -- Created 4 years, 6 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 | « ui/base/ui_base_tests.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/textfield/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 case ui::TextEditCommand::MOVE_PAGE_DOWN: 1492 case ui::TextEditCommand::MOVE_PAGE_DOWN:
1493 case ui::TextEditCommand::MOVE_PAGE_DOWN_AND_MODIFY_SELECTION: 1493 case ui::TextEditCommand::MOVE_PAGE_DOWN_AND_MODIFY_SELECTION:
1494 case ui::TextEditCommand::MOVE_PAGE_UP: 1494 case ui::TextEditCommand::MOVE_PAGE_UP:
1495 case ui::TextEditCommand::MOVE_PAGE_UP_AND_MODIFY_SELECTION: 1495 case ui::TextEditCommand::MOVE_PAGE_UP_AND_MODIFY_SELECTION:
1496 case ui::TextEditCommand::MOVE_UP: 1496 case ui::TextEditCommand::MOVE_UP:
1497 case ui::TextEditCommand::MOVE_UP_AND_MODIFY_SELECTION: 1497 case ui::TextEditCommand::MOVE_UP_AND_MODIFY_SELECTION:
1498 case ui::TextEditCommand::INSERT_TEXT: 1498 case ui::TextEditCommand::INSERT_TEXT:
1499 case ui::TextEditCommand::SET_MARK: 1499 case ui::TextEditCommand::SET_MARK:
1500 case ui::TextEditCommand::UNSELECT: 1500 case ui::TextEditCommand::UNSELECT:
1501 case ui::TextEditCommand::INVALID_COMMAND: 1501 case ui::TextEditCommand::INVALID_COMMAND:
1502 case ui::TextEditCommand::NUMBER_OF_COMMANDS:
1502 return false; 1503 return false;
1503 } 1504 }
1504 NOTREACHED(); 1505 NOTREACHED();
1505 return false; 1506 return false;
1506 } 1507 }
1507 1508
1508 void Textfield::SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) { 1509 void Textfield::SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) {
1509 DCHECK_EQ(ui::TextEditCommand::INVALID_COMMAND, scheduled_text_edit_command_); 1510 DCHECK_EQ(ui::TextEditCommand::INVALID_COMMAND, scheduled_text_edit_command_);
1510 scheduled_text_edit_command_ = command; 1511 scheduled_text_edit_command_ = command;
1511 } 1512 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 case ui::TextEditCommand::MOVE_PAGE_DOWN: 1689 case ui::TextEditCommand::MOVE_PAGE_DOWN:
1689 case ui::TextEditCommand::MOVE_PAGE_DOWN_AND_MODIFY_SELECTION: 1690 case ui::TextEditCommand::MOVE_PAGE_DOWN_AND_MODIFY_SELECTION:
1690 case ui::TextEditCommand::MOVE_PAGE_UP: 1691 case ui::TextEditCommand::MOVE_PAGE_UP:
1691 case ui::TextEditCommand::MOVE_PAGE_UP_AND_MODIFY_SELECTION: 1692 case ui::TextEditCommand::MOVE_PAGE_UP_AND_MODIFY_SELECTION:
1692 case ui::TextEditCommand::MOVE_UP: 1693 case ui::TextEditCommand::MOVE_UP:
1693 case ui::TextEditCommand::MOVE_UP_AND_MODIFY_SELECTION: 1694 case ui::TextEditCommand::MOVE_UP_AND_MODIFY_SELECTION:
1694 case ui::TextEditCommand::INSERT_TEXT: 1695 case ui::TextEditCommand::INSERT_TEXT:
1695 case ui::TextEditCommand::SET_MARK: 1696 case ui::TextEditCommand::SET_MARK:
1696 case ui::TextEditCommand::UNSELECT: 1697 case ui::TextEditCommand::UNSELECT:
1697 case ui::TextEditCommand::INVALID_COMMAND: 1698 case ui::TextEditCommand::INVALID_COMMAND:
1699 case ui::TextEditCommand::NUMBER_OF_COMMANDS:
1698 NOTREACHED(); 1700 NOTREACHED();
1699 break; 1701 break;
1700 } 1702 }
1701 1703
1702 cursor_changed |= GetSelectionModel() != selection_model; 1704 cursor_changed |= GetSelectionModel() != selection_model;
1703 if (cursor_changed) 1705 if (cursor_changed)
1704 UpdateSelectionClipboard(); 1706 UpdateSelectionClipboard();
1705 UpdateAfterChange(text_changed, cursor_changed); 1707 UpdateAfterChange(text_changed, cursor_changed);
1706 OnAfterUserAction(); 1708 OnAfterUserAction();
1707 } 1709 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 RequestFocus(); 1963 RequestFocus();
1962 model_->MoveCursorTo(mouse); 1964 model_->MoveCursorTo(mouse);
1963 if (!selection_clipboard_text.empty()) { 1965 if (!selection_clipboard_text.empty()) {
1964 model_->InsertText(selection_clipboard_text); 1966 model_->InsertText(selection_clipboard_text);
1965 UpdateAfterChange(true, true); 1967 UpdateAfterChange(true, true);
1966 } 1968 }
1967 OnAfterUserAction(); 1969 OnAfterUserAction();
1968 } 1970 }
1969 1971
1970 } // namespace views 1972 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/ui_base_tests.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698