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

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

Issue 919543003: Make Textfield::GetTextInputClient() return non-null, even if readonly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150211-MacViews-TextfileTest-B-split-input-method
Patch Set: More checks Created 5 years, 10 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 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "ui/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 693
694 const int command = GetCommandForKeyEvent(event, HasSelection()); 694 const int command = GetCommandForKeyEvent(event, HasSelection());
695 if (!handled && IsCommandIdEnabled(command)) { 695 if (!handled && IsCommandIdEnabled(command)) {
696 ExecuteCommand(command); 696 ExecuteCommand(command);
697 handled = true; 697 handled = true;
698 } 698 }
699 return handled; 699 return handled;
700 } 700 }
701 701
702 ui::TextInputClient* Textfield::GetTextInputClient() { 702 ui::TextInputClient* Textfield::GetTextInputClient() {
703 return read_only_ ? NULL : this; 703 return this;
704 } 704 }
705 705
706 void Textfield::OnGestureEvent(ui::GestureEvent* event) { 706 void Textfield::OnGestureEvent(ui::GestureEvent* event) {
707 switch (event->type()) { 707 switch (event->type()) {
708 case ui::ET_GESTURE_TAP_DOWN: 708 case ui::ET_GESTURE_TAP_DOWN:
709 RequestFocus(); 709 RequestFocus();
710 ShowImeIfNeeded(); 710 ShowImeIfNeeded();
711 event->SetHandled(); 711 event->SetHandled();
712 break; 712 break;
713 case ui::ET_GESTURE_TAP: 713 case ui::ET_GESTURE_TAP:
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 const size_t length = selection_clipboard_text.length(); 1873 const size_t length = selection_clipboard_text.length();
1874 range = gfx::Range(range.start() + length, range.end() + length); 1874 range = gfx::Range(range.start() + length, range.end() + length);
1875 } 1875 }
1876 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); 1876 model_->MoveCursorTo(gfx::SelectionModel(range, affinity));
1877 UpdateAfterChange(true, true); 1877 UpdateAfterChange(true, true);
1878 OnAfterUserAction(); 1878 OnAfterUserAction();
1879 } 1879 }
1880 } 1880 }
1881 1881
1882 } // namespace views 1882 } // 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