| OLD | NEW |
| 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/native_textfield_win.h" | 5 #include "ui/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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 context_menu_->RunContextMenuAt(gfx::Point(p)); | 525 context_menu_->RunContextMenuAt(gfx::Point(p)); |
| 526 } | 526 } |
| 527 | 527 |
| 528 void NativeTextfieldWin::OnCopy() { | 528 void NativeTextfieldWin::OnCopy() { |
| 529 if (textfield_->IsObscured()) | 529 if (textfield_->IsObscured()) |
| 530 return; | 530 return; |
| 531 | 531 |
| 532 const string16 text(GetSelectedText()); | 532 const string16 text(GetSelectedText()); |
| 533 if (!text.empty() && ViewsDelegate::views_delegate) { | 533 if (!text.empty() && ViewsDelegate::views_delegate) { |
| 534 ui::ScopedClipboardWriter scw( | 534 ui::ScopedClipboardWriter scw( |
| 535 ViewsDelegate::views_delegate->GetClipboard()); | 535 ViewsDelegate::views_delegate->GetClipboard(), |
| 536 ui::Clipboard::BUFFER_STANDARD); |
| 536 scw.WriteText(text); | 537 scw.WriteText(text); |
| 537 } | 538 } |
| 538 } | 539 } |
| 539 | 540 |
| 540 void NativeTextfieldWin::OnCut() { | 541 void NativeTextfieldWin::OnCut() { |
| 541 if (textfield_->read_only() || textfield_->IsObscured()) | 542 if (textfield_->read_only() || textfield_->IsObscured()) |
| 542 return; | 543 return; |
| 543 | 544 |
| 544 OnCopy(); | 545 OnCopy(); |
| 545 | 546 |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 | 1158 |
| 1158 // static | 1159 // static |
| 1159 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1160 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 1160 Textfield* field) { | 1161 Textfield* field) { |
| 1161 if (views::Widget::IsPureViews()) | 1162 if (views::Widget::IsPureViews()) |
| 1162 return new NativeTextfieldViews(field); | 1163 return new NativeTextfieldViews(field); |
| 1163 return new NativeTextfieldWin(field); | 1164 return new NativeTextfieldWin(field); |
| 1164 } | 1165 } |
| 1165 | 1166 |
| 1166 } // namespace views | 1167 } // namespace views |
| OLD | NEW |