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

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

Issue 12388011: Two fixes to touch selection: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 9 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/touchui/touch_selection_controller_impl.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/native_textfield_views.h" 5 #include "ui/views/controls/textfield/native_textfield_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 return editable && model_->HasSelection() && !textfield_->IsObscured(); 715 return editable && model_->HasSelection() && !textfield_->IsObscured();
716 case IDS_APP_COPY: 716 case IDS_APP_COPY:
717 return model_->HasSelection() && !textfield_->IsObscured(); 717 return model_->HasSelection() && !textfield_->IsObscured();
718 case IDS_APP_PASTE: 718 case IDS_APP_PASTE:
719 ui::Clipboard::GetForCurrentThread()->ReadText( 719 ui::Clipboard::GetForCurrentThread()->ReadText(
720 ui::Clipboard::BUFFER_STANDARD, &result); 720 ui::Clipboard::BUFFER_STANDARD, &result);
721 return editable && !result.empty(); 721 return editable && !result.empty();
722 case IDS_APP_DELETE: 722 case IDS_APP_DELETE:
723 return editable && model_->HasSelection(); 723 return editable && model_->HasSelection();
724 case IDS_APP_SELECT_ALL: 724 case IDS_APP_SELECT_ALL:
725 return true; 725 return !model_->GetText().empty();
726 default: 726 default:
727 return textfield_->GetController()->IsCommandIdEnabled(command_id); 727 return textfield_->GetController()->IsCommandIdEnabled(command_id);
728 } 728 }
729 } 729 }
730 730
731 bool NativeTextfieldViews::GetAcceleratorForCommandId(int command_id, 731 bool NativeTextfieldViews::GetAcceleratorForCommandId(int command_id,
732 ui::Accelerator* accelerator) { 732 ui::Accelerator* accelerator) {
733 return false; 733 return false;
734 } 734 }
735 735
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 1388
1389 void NativeTextfieldViews::PlatformGestureEventHandling( 1389 void NativeTextfieldViews::PlatformGestureEventHandling(
1390 const ui::GestureEvent* event) { 1390 const ui::GestureEvent* event) {
1391 #if defined(OS_WIN) && defined(USE_AURA) 1391 #if defined(OS_WIN) && defined(USE_AURA)
1392 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only()) 1392 if (event->type() == ui::ET_GESTURE_TAP_DOWN && !textfield_->read_only())
1393 base::win::DisplayVirtualKeyboard(); 1393 base::win::DisplayVirtualKeyboard();
1394 #endif 1394 #endif
1395 } 1395 }
1396 1396
1397 } // namespace views 1397 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698