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

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

Issue 739323002: Requests for tabs permission for VirtualKeyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/views/controls/textfield/textfield.h ('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 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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 1551
1552 bool Textfield::SetSelectionRange(const gfx::Range& range) { 1552 bool Textfield::SetSelectionRange(const gfx::Range& range) {
1553 if (!ImeEditingAllowed() || !range.IsValid()) 1553 if (!ImeEditingAllowed() || !range.IsValid())
1554 return false; 1554 return false;
1555 OnBeforeUserAction(); 1555 OnBeforeUserAction();
1556 SelectRange(range); 1556 SelectRange(range);
1557 OnAfterUserAction(); 1557 OnAfterUserAction();
1558 return true; 1558 return true;
1559 } 1559 }
1560 1560
1561 uint32 Textfield::GetSelectionOffset() const {
1562 return 0;
1563 }
1564
1561 bool Textfield::DeleteRange(const gfx::Range& range) { 1565 bool Textfield::DeleteRange(const gfx::Range& range) {
1562 if (!ImeEditingAllowed() || range.is_empty()) 1566 if (!ImeEditingAllowed() || range.is_empty())
1563 return false; 1567 return false;
1564 1568
1565 OnBeforeUserAction(); 1569 OnBeforeUserAction();
1566 model_->SelectRange(range); 1570 model_->SelectRange(range);
1567 if (model_->HasSelection()) { 1571 if (model_->HasSelection()) {
1568 model_->DeleteSelection(); 1572 model_->DeleteSelection();
1569 UpdateAfterChange(true, true); 1573 UpdateAfterChange(true, true);
1570 } 1574 }
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 RequestFocus(); 1896 RequestFocus();
1893 model_->MoveCursorTo(mouse); 1897 model_->MoveCursorTo(mouse);
1894 if (!selection_clipboard_text.empty()) { 1898 if (!selection_clipboard_text.empty()) {
1895 model_->InsertText(selection_clipboard_text); 1899 model_->InsertText(selection_clipboard_text);
1896 UpdateAfterChange(true, true); 1900 UpdateAfterChange(true, true);
1897 } 1901 }
1898 OnAfterUserAction(); 1902 OnAfterUserAction();
1899 } 1903 }
1900 1904
1901 } // namespace views 1905 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698