OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/views/text_field.h" | 5 #include "chrome/views/text_field.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlapp.h> | 8 #include <atlapp.h> |
9 #include <atlcrack.h> | 9 #include <atlcrack.h> |
10 #include <atlctrls.h> | 10 #include <atlctrls.h> |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 tracking_double_click_ = false; | 754 tracking_double_click_ = false; |
755 SetMsgHandled(false); | 755 SetMsgHandled(false); |
756 } | 756 } |
757 | 757 |
758 void TextField::Edit::OnPaste() { | 758 void TextField::Edit::OnPaste() { |
759 if (parent_->IsReadOnly()) | 759 if (parent_->IsReadOnly()) |
760 return; | 760 return; |
761 | 761 |
762 ClipboardService* clipboard = g_browser_process->clipboard_service(); | 762 ClipboardService* clipboard = g_browser_process->clipboard_service(); |
763 | 763 |
764 if (!clipboard->IsFormatAvailable(CF_UNICODETEXT)) | 764 if (!clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType())) |
765 return; | 765 return; |
766 | 766 |
767 std::wstring clipboard_str; | 767 std::wstring clipboard_str; |
768 clipboard->ReadText(&clipboard_str); | 768 clipboard->ReadText(&clipboard_str); |
769 if (!clipboard_str.empty()) { | 769 if (!clipboard_str.empty()) { |
770 std::wstring collapsed(CollapseWhitespace(clipboard_str, false)); | 770 std::wstring collapsed(CollapseWhitespace(clipboard_str, false)); |
771 if (parent_->GetStyle() & STYLE_LOWERCASE) | 771 if (parent_->GetStyle() & STYLE_LOWERCASE) |
772 collapsed = l10n_util::ToLower(collapsed); | 772 collapsed = l10n_util::ToLower(collapsed); |
773 ReplaceSel(collapsed.c_str(), true); | 773 ReplaceSel(collapsed.c_str(), true); |
774 } | 774 } |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 | 1115 |
1116 COLORREF bg_color; | 1116 COLORREF bg_color; |
1117 if (!use_default_background_color_) | 1117 if (!use_default_background_color_) |
1118 bg_color = skia::SkColorToCOLORREF(background_color_); | 1118 bg_color = skia::SkColorToCOLORREF(background_color_); |
1119 else | 1119 else |
1120 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW); | 1120 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW); |
1121 edit_->SetBackgroundColor(bg_color); | 1121 edit_->SetBackgroundColor(bg_color); |
1122 } | 1122 } |
1123 | 1123 |
1124 } // namespace views | 1124 } // namespace views |
OLD | NEW |