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

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

Issue 2829823002: [Textfield] Consider select all status for select all context menu (Closed)
Patch Set: Cleanup test code 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 | « no previous file | ui/views/controls/textfield/textfield_unittest.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 (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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 return editable && model_->CanRedo(); 1539 return editable && model_->CanRedo();
1540 case ui::TextEditCommand::CUT: 1540 case ui::TextEditCommand::CUT:
1541 return editable && readable && model_->HasSelection(); 1541 return editable && readable && model_->HasSelection();
1542 case ui::TextEditCommand::COPY: 1542 case ui::TextEditCommand::COPY:
1543 return readable && model_->HasSelection(); 1543 return readable && model_->HasSelection();
1544 case ui::TextEditCommand::PASTE: 1544 case ui::TextEditCommand::PASTE:
1545 ui::Clipboard::GetForCurrentThread()->ReadText( 1545 ui::Clipboard::GetForCurrentThread()->ReadText(
1546 ui::CLIPBOARD_TYPE_COPY_PASTE, &result); 1546 ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
1547 return editable && !result.empty(); 1547 return editable && !result.empty();
1548 case ui::TextEditCommand::SELECT_ALL: 1548 case ui::TextEditCommand::SELECT_ALL:
1549 return !text().empty(); 1549 return !text().empty() && GetSelectedRange().length() != text().length();
1550 case ui::TextEditCommand::TRANSPOSE: 1550 case ui::TextEditCommand::TRANSPOSE:
1551 return editable && !model_->HasSelection() && 1551 return editable && !model_->HasSelection() &&
1552 !model_->HasCompositionText(); 1552 !model_->HasCompositionText();
1553 case ui::TextEditCommand::YANK: 1553 case ui::TextEditCommand::YANK:
1554 return editable; 1554 return editable;
1555 case ui::TextEditCommand::MOVE_DOWN: 1555 case ui::TextEditCommand::MOVE_DOWN:
1556 case ui::TextEditCommand::MOVE_DOWN_AND_MODIFY_SELECTION: 1556 case ui::TextEditCommand::MOVE_DOWN_AND_MODIFY_SELECTION:
1557 case ui::TextEditCommand::MOVE_PAGE_DOWN: 1557 case ui::TextEditCommand::MOVE_PAGE_DOWN:
1558 case ui::TextEditCommand::MOVE_PAGE_DOWN_AND_MODIFY_SELECTION: 1558 case ui::TextEditCommand::MOVE_PAGE_DOWN_AND_MODIFY_SELECTION:
1559 case ui::TextEditCommand::MOVE_PAGE_UP: 1559 case ui::TextEditCommand::MOVE_PAGE_UP:
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 cursor_blink_timer_.Stop(); 2098 cursor_blink_timer_.Stop();
2099 } 2099 }
2100 2100
2101 void Textfield::OnCursorBlinkTimerFired() { 2101 void Textfield::OnCursorBlinkTimerFired() {
2102 DCHECK(ShouldBlinkCursor()); 2102 DCHECK(ShouldBlinkCursor());
2103 cursor_view_.SetVisible(!cursor_view_.visible()); 2103 cursor_view_.SetVisible(!cursor_view_.visible());
2104 UpdateCursorViewPosition(); 2104 UpdateCursorViewPosition();
2105 } 2105 }
2106 2106
2107 } // namespace views 2107 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698