| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 #include "app/l10n_util_win.h" | 6 #include "app/l10n_util_win.h" |
| 7 #include "app/win_util.h" | 7 #include "app/win_util.h" |
| 8 #include "base/clipboard.h" | 8 #include "base/clipboard.h" |
| 9 #include "base/gfx/native_theme.h" | 9 #include "base/gfx/native_theme.h" |
| 10 #include "base/scoped_clipboard_writer.h" | 10 #include "base/scoped_clipboard_writer.h" |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // call this for M and R down. | 657 // call this for M and R down. |
| 658 tracking_double_click_ = false; | 658 tracking_double_click_ = false; |
| 659 SetMsgHandled(false); | 659 SetMsgHandled(false); |
| 660 } | 660 } |
| 661 | 661 |
| 662 void NativeTextfieldWin::OnPaste() { | 662 void NativeTextfieldWin::OnPaste() { |
| 663 if (textfield_->read_only() || !ViewsDelegate::views_delegate) | 663 if (textfield_->read_only() || !ViewsDelegate::views_delegate) |
| 664 return; | 664 return; |
| 665 | 665 |
| 666 Clipboard* clipboard = ViewsDelegate::views_delegate->GetClipboard(); | 666 Clipboard* clipboard = ViewsDelegate::views_delegate->GetClipboard(); |
| 667 if (!clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType())) | 667 if (!clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType(), |
| 668 Clipboard::BUFFER_STANDARD)) |
| 668 return; | 669 return; |
| 669 | 670 |
| 670 std::wstring clipboard_str; | 671 std::wstring clipboard_str; |
| 671 clipboard->ReadText(&clipboard_str); | 672 clipboard->ReadText(Clipboard::BUFFER_STANDARD, &clipboard_str); |
| 672 if (!clipboard_str.empty()) { | 673 if (!clipboard_str.empty()) { |
| 673 std::wstring collapsed(CollapseWhitespace(clipboard_str, false)); | 674 std::wstring collapsed(CollapseWhitespace(clipboard_str, false)); |
| 674 if (textfield_->style() & Textfield::STYLE_LOWERCASE) | 675 if (textfield_->style() & Textfield::STYLE_LOWERCASE) |
| 675 collapsed = l10n_util::ToLower(collapsed); | 676 collapsed = l10n_util::ToLower(collapsed); |
| 676 // Force a Paste operation to trigger OnContentsChanged, even if identical | 677 // Force a Paste operation to trigger OnContentsChanged, even if identical |
| 677 // contents are pasted into the text box. | 678 // contents are pasted into the text box. |
| 678 text_before_change_.clear(); | 679 text_before_change_.clear(); |
| 679 ReplaceSel(collapsed.c_str(), true); | 680 ReplaceSel(collapsed.c_str(), true); |
| 680 } | 681 } |
| 681 } | 682 } |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 //////////////////////////////////////////////////////////////////////////////// | 867 //////////////////////////////////////////////////////////////////////////////// |
| 867 // NativeTextfieldWrapper, public: | 868 // NativeTextfieldWrapper, public: |
| 868 | 869 |
| 869 // static | 870 // static |
| 870 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 871 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 871 Textfield* field) { | 872 Textfield* field) { |
| 872 return new NativeTextfieldWin(field); | 873 return new NativeTextfieldWin(field); |
| 873 } | 874 } |
| 874 | 875 |
| 875 } // namespace views | 876 } // namespace views |
| OLD | NEW |