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

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

Issue 26248004: Views Textfield/Omnibox: Do not paste on Ctrl+Alt[Gr]+V or AltGr+V. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify test comments. Created 7 years, 2 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 | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('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) 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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 if (key_event.type() == ui::ET_KEY_PRESSED) { 1185 if (key_event.type() == ui::ET_KEY_PRESSED) {
1186 ui::KeyboardCode key_code = key_event.key_code(); 1186 ui::KeyboardCode key_code = key_event.key_code();
1187 if (key_code == ui::VKEY_TAB || key_event.IsUnicodeKeyCode()) 1187 if (key_code == ui::VKEY_TAB || key_event.IsUnicodeKeyCode())
1188 return false; 1188 return false;
1189 1189
1190 OnBeforeUserAction(); 1190 OnBeforeUserAction();
1191 const bool editable = !textfield_->read_only(); 1191 const bool editable = !textfield_->read_only();
1192 const bool readable = !textfield_->IsObscured(); 1192 const bool readable = !textfield_->IsObscured();
1193 const bool shift = key_event.IsShiftDown(); 1193 const bool shift = key_event.IsShiftDown();
1194 const bool control = key_event.IsControlDown(); 1194 const bool control = key_event.IsControlDown();
1195 const bool alt = key_event.IsAltDown(); 1195 const bool alt = key_event.IsAltDown() || key_event.IsAltGrDown();
1196 bool text_changed = false; 1196 bool text_changed = false;
1197 bool cursor_changed = false; 1197 bool cursor_changed = false;
1198 switch (key_code) { 1198 switch (key_code) {
1199 case ui::VKEY_Z: 1199 case ui::VKEY_Z:
1200 if (control && !shift && !alt && editable) 1200 if (control && !shift && !alt && editable)
1201 cursor_changed = text_changed = model_->Undo(); 1201 cursor_changed = text_changed = model_->Undo();
1202 else if (control && shift && !alt && editable) 1202 else if (control && shift && !alt && editable)
1203 cursor_changed = text_changed = model_->Redo(); 1203 cursor_changed = text_changed = model_->Redo();
1204 break; 1204 break;
1205 case ui::VKEY_Y: 1205 case ui::VKEY_Y:
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 if (index != -1) { 1520 if (index != -1) {
1521 obscured_reveal_timer_.Start( 1521 obscured_reveal_timer_.Start(
1522 FROM_HERE, 1522 FROM_HERE,
1523 duration, 1523 duration,
1524 base::Bind(&NativeTextfieldViews::RevealObscuredChar, 1524 base::Bind(&NativeTextfieldViews::RevealObscuredChar,
1525 base::Unretained(this), -1, base::TimeDelta())); 1525 base::Unretained(this), -1, base::TimeDelta()));
1526 } 1526 }
1527 } 1527 }
1528 1528
1529 } // namespace views 1529 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698