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

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

Issue 2684203002: MacViews/a11y: Allow accessibility clients to set new selections in Textfields. (Closed)
Patch Set: Update to allow selection range changes when read-only. Created 3 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
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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 } 1408 }
1409 1409
1410 bool Textfield::GetSelectionRange(gfx::Range* range) const { 1410 bool Textfield::GetSelectionRange(gfx::Range* range) const {
1411 if (!ImeEditingAllowed()) 1411 if (!ImeEditingAllowed())
1412 return false; 1412 return false;
1413 *range = GetRenderText()->selection(); 1413 *range = GetRenderText()->selection();
1414 return true; 1414 return true;
1415 } 1415 }
1416 1416
1417 bool Textfield::SetSelectionRange(const gfx::Range& range) { 1417 bool Textfield::SetSelectionRange(const gfx::Range& range) {
1418 if (!ImeEditingAllowed() || !range.IsValid()) 1418 if (!enabled() || !range.IsValid())
tapted 2017/02/14 05:45:32 as discussed - I'm not sure about changing this wi
Patti Lor 2017/02/15 06:34:47 Yep, so as discovered & discussed offline, selecti
1419 return false; 1419 return false;
1420 OnBeforeUserAction(); 1420 OnBeforeUserAction();
1421 SelectRange(range); 1421 SelectRange(range);
1422 OnAfterUserAction(); 1422 OnAfterUserAction();
1423 return true; 1423 return true;
1424 } 1424 }
1425 1425
1426 bool Textfield::DeleteRange(const gfx::Range& range) { 1426 bool Textfield::DeleteRange(const gfx::Range& range) {
1427 if (!ImeEditingAllowed() || range.is_empty()) 1427 if (!ImeEditingAllowed() || range.is_empty())
1428 return false; 1428 return false;
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 } 2096 }
2097 2097
2098 void Textfield::OnCursorBlinkTimerFired() { 2098 void Textfield::OnCursorBlinkTimerFired() {
2099 DCHECK(ShouldBlinkCursor()); 2099 DCHECK(ShouldBlinkCursor());
2100 gfx::RenderText* render_text = GetRenderText(); 2100 gfx::RenderText* render_text = GetRenderText();
2101 render_text->set_cursor_visible(!render_text->cursor_visible()); 2101 render_text->set_cursor_visible(!render_text->cursor_visible());
2102 RepaintCursor(); 2102 RepaintCursor();
2103 } 2103 }
2104 2104
2105 } // namespace views 2105 } // namespace views
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_mac.mm ('k') | ui/views/widget/native_widget_mac_accessibility_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698