diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/textfield/native_textfield_win.cc | 5 | ||||
-rw-r--r-- | views/view_unittest.cc | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc index 6bae442..e152dbe 100644 --- a/views/controls/textfield/native_textfield_win.cc +++ b/views/controls/textfield/native_textfield_win.cc @@ -664,11 +664,12 @@ void NativeTextfieldWin::OnPaste() { return; Clipboard* clipboard = ViewsDelegate::views_delegate->GetClipboard(); - if (!clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType())) + if (!clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType(), + Clipboard::BUFFER_STANDARD)) return; std::wstring clipboard_str; - clipboard->ReadText(&clipboard_str); + clipboard->ReadText(Clipboard::BUFFER_STANDARD, &clipboard_str); if (!clipboard_str.empty()) { std::wstring collapsed(CollapseWhitespace(clipboard_str, false)); if (textfield_->style() & Textfield::STYLE_LOWERCASE) diff --git a/views/view_unittest.cc b/views/view_unittest.cc index e02afd73a..613c522 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -727,7 +727,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { ::SendMessage(normal->GetTestingHandle(), WM_CUT, 0, 0); string16 result; - clipboard.ReadText(&result); + clipboard.ReadText(Clipboard::BUFFER_STANDARD, &result); EXPECT_EQ(kNormalText, result); normal->SetText(kNormalText); // Let's revert to the original content. @@ -735,7 +735,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { read_only->SelectAll(); ::SendMessage(read_only->GetTestingHandle(), WM_CUT, 0, 0); result.clear(); - clipboard.ReadText(&result); + clipboard.ReadText(Clipboard::BUFFER_STANDARD, &result); // Cut should have failed, so the clipboard content should not have changed. EXPECT_EQ(kNormalText, result); @@ -743,7 +743,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { password->SelectAll(); ::SendMessage(password->GetTestingHandle(), WM_CUT, 0, 0); result.clear(); - clipboard.ReadText(&result); + clipboard.ReadText(Clipboard::BUFFER_STANDARD, &result); // Cut should have failed, so the clipboard content should not have changed. EXPECT_EQ(kNormalText, result); @@ -756,19 +756,19 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { read_only->SelectAll(); ::SendMessage(read_only->GetTestingHandle(), WM_COPY, 0, 0); result.clear(); - clipboard.ReadText(&result); + clipboard.ReadText(Clipboard::BUFFER_STANDARD, &result); EXPECT_EQ(kReadOnlyText, result); normal->SelectAll(); ::SendMessage(normal->GetTestingHandle(), WM_COPY, 0, 0); result.clear(); - clipboard.ReadText(&result); + clipboard.ReadText(Clipboard::BUFFER_STANDARD, &result); EXPECT_EQ(kNormalText, result); password->SelectAll(); ::SendMessage(password->GetTestingHandle(), WM_COPY, 0, 0); result.clear(); - clipboard.ReadText(&result); + clipboard.ReadText(Clipboard::BUFFER_STANDARD, &result); // We don't let you copy from a password field, clipboard should not have // changed. EXPECT_EQ(kNormalText, result); |