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

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

Issue 6034002: Replace Textfield::Keystroke with views::KeyEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: key_code, ET_KEY_PRESS for WM_CHAR Created 9 years, 11 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 | « views/controls/textfield/textfield.h ('k') | views/event.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/textfield/textfield.h" 5 #include "views/controls/textfield/textfield.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #endif 9 #endif
10 10
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // Remove the include for native_textfield_win.h above when you fix this. 347 // Remove the include for native_textfield_win.h above when you fix this.
348 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack(); 348 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack();
349 #endif 349 #endif
350 } 350 }
351 } 351 }
352 352
353 std::string Textfield::GetClassName() const { 353 std::string Textfield::GetClassName() const {
354 return kViewClassName; 354 return kViewClassName;
355 } 355 }
356 356
357 app::KeyboardCode Textfield::Keystroke::GetKeyboardCode() const {
358 #if defined(OS_WIN)
359 return static_cast<app::KeyboardCode>(key_);
360 #else
361 return event_->GetKeyCode();
362 #endif
363 }
364
365 #if defined(OS_WIN)
366 bool Textfield::Keystroke::IsControlHeld() const {
367 return base::win::IsCtrlPressed();
368 }
369
370 bool Textfield::Keystroke::IsShiftHeld() const {
371 return base::win::IsShiftPressed();
372 }
373 #else
374 bool Textfield::Keystroke::IsControlHeld() const {
375 return event_->IsControlDown();
376 }
377
378 bool Textfield::Keystroke::IsShiftHeld() const {
379 return event_->IsShiftDown();
380 }
381 #endif
382
383 } // namespace views 357 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/textfield/textfield.h ('k') | views/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698