OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/native_textfield_win.h" | 5 #include "views/controls/textfield/native_textfield_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 return false; | 409 return false; |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 bool NativeTextfieldWin::GetAcceleratorForCommandId(int command_id, | 413 bool NativeTextfieldWin::GetAcceleratorForCommandId(int command_id, |
414 ui::Accelerator* accelerator) { | 414 ui::Accelerator* accelerator) { |
415 // The standard Ctrl-X, Ctrl-V and Ctrl-C are not defined as accelerators | 415 // The standard Ctrl-X, Ctrl-V and Ctrl-C are not defined as accelerators |
416 // anywhere so we need to check for them explicitly here. | 416 // anywhere so we need to check for them explicitly here. |
417 switch (command_id) { | 417 switch (command_id) { |
418 case IDS_APP_CUT: | 418 case IDS_APP_CUT: |
419 *accelerator = views::Accelerator(ui::VKEY_X, false, true, false); | 419 *accelerator = ui::Accelerator(ui::VKEY_X, false, true, false); |
420 return true; | 420 return true; |
421 case IDS_APP_COPY: | 421 case IDS_APP_COPY: |
422 *accelerator = views::Accelerator(ui::VKEY_C, false, true, false); | 422 *accelerator = ui::Accelerator(ui::VKEY_C, false, true, false); |
423 return true; | 423 return true; |
424 case IDS_APP_PASTE: | 424 case IDS_APP_PASTE: |
425 *accelerator = views::Accelerator(ui::VKEY_V, false, true, false); | 425 *accelerator = ui::Accelerator(ui::VKEY_V, false, true, false); |
426 return true; | 426 return true; |
427 } | 427 } |
428 return container_view_->GetWidget()->GetAccelerator(command_id, accelerator); | 428 return container_view_->GetWidget()->GetAccelerator(command_id, accelerator); |
429 } | 429 } |
430 | 430 |
431 void NativeTextfieldWin::ExecuteCommand(int command_id) { | 431 void NativeTextfieldWin::ExecuteCommand(int command_id) { |
432 ScopedFreeze freeze(this, GetTextObjectModel()); | 432 ScopedFreeze freeze(this, GetTextObjectModel()); |
433 OnBeforePossibleChange(); | 433 OnBeforePossibleChange(); |
434 switch (command_id) { | 434 switch (command_id) { |
435 case IDS_APP_UNDO: Undo(); break; | 435 case IDS_APP_UNDO: Undo(); break; |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 | 1159 |
1160 // static | 1160 // static |
1161 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1161 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
1162 Textfield* field) { | 1162 Textfield* field) { |
1163 if (views::Widget::IsPureViews()) | 1163 if (views::Widget::IsPureViews()) |
1164 return new NativeTextfieldViews(field); | 1164 return new NativeTextfieldViews(field); |
1165 return new NativeTextfieldWin(field); | 1165 return new NativeTextfieldWin(field); |
1166 } | 1166 } |
1167 | 1167 |
1168 } // namespace views | 1168 } // namespace views |
OLD | NEW |