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

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

Issue 103293004: No touch handles when Views textfield cannot get focused (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated after r288781 Created 6 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 | Annotate | Revision Log
« 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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "grit/ui_strings.h" 10 #include "grit/ui_strings.h"
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 SchedulePaint(); 1746 SchedulePaint();
1747 1747
1748 if (index != -1) { 1748 if (index != -1) {
1749 password_reveal_timer_.Start(FROM_HERE, password_reveal_duration_, 1749 password_reveal_timer_.Start(FROM_HERE, password_reveal_duration_,
1750 base::Bind(&Textfield::RevealPasswordChar, 1750 base::Bind(&Textfield::RevealPasswordChar,
1751 weak_ptr_factory_.GetWeakPtr(), -1)); 1751 weak_ptr_factory_.GetWeakPtr(), -1));
1752 } 1752 }
1753 } 1753 }
1754 1754
1755 void Textfield::CreateTouchSelectionControllerAndNotifyIt() { 1755 void Textfield::CreateTouchSelectionControllerAndNotifyIt() {
1756 if (!HasFocus())
1757 return;
1758
1756 if (!touch_selection_controller_) { 1759 if (!touch_selection_controller_) {
1757 touch_selection_controller_.reset( 1760 touch_selection_controller_.reset(
1758 ui::TouchSelectionController::create(this)); 1761 ui::TouchSelectionController::create(this));
1759 } 1762 }
1760 if (touch_selection_controller_) 1763 if (touch_selection_controller_)
1761 touch_selection_controller_->SelectionChanged(); 1764 touch_selection_controller_->SelectionChanged();
1762 } 1765 }
1763 1766
1764 void Textfield::UpdateSelectionClipboard() const { 1767 void Textfield::UpdateSelectionClipboard() const {
1765 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 1768 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
(...skipping 24 matching lines...) Expand all
1790 const size_t length = selection_clipboard_text.length(); 1793 const size_t length = selection_clipboard_text.length();
1791 range = gfx::Range(range.start() + length, range.end() + length); 1794 range = gfx::Range(range.start() + length, range.end() + length);
1792 } 1795 }
1793 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); 1796 model_->MoveCursorTo(gfx::SelectionModel(range, affinity));
1794 UpdateAfterChange(true, true); 1797 UpdateAfterChange(true, true);
1795 OnAfterUserAction(); 1798 OnAfterUserAction();
1796 } 1799 }
1797 } 1800 }
1798 1801
1799 } // namespace views 1802 } // 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