Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: ui/views/controls/textfield/native_textfield_views_unittest.cc

Issue 9232075: Have ScopedClipboardWriter and Clipboard::WriteObjects take a buffer parameter. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix build error. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 string16 GetClipboardText() const { 238 string16 GetClipboardText() const {
239 string16 text; 239 string16 text;
240 views::ViewsDelegate::views_delegate->GetClipboard()-> 240 views::ViewsDelegate::views_delegate->GetClipboard()->
241 ReadText(ui::Clipboard::BUFFER_STANDARD, &text); 241 ReadText(ui::Clipboard::BUFFER_STANDARD, &text);
242 return text; 242 return text;
243 } 243 }
244 244
245 void SetClipboardText(const std::string& text) { 245 void SetClipboardText(const std::string& text) {
246 ui::ScopedClipboardWriter clipboard_writer( 246 ui::ScopedClipboardWriter clipboard_writer(
247 views::ViewsDelegate::views_delegate->GetClipboard()); 247 views::ViewsDelegate::views_delegate->GetClipboard(),
248 ui::Clipboard::BUFFER_STANDARD);
248 clipboard_writer.WriteText(ASCIIToUTF16(text)); 249 clipboard_writer.WriteText(ASCIIToUTF16(text));
249 } 250 }
250 251
251 View* GetFocusedView() { 252 View* GetFocusedView() {
252 return widget_->GetFocusManager()->GetFocusedView(); 253 return widget_->GetFocusManager()->GetFocusedView();
253 } 254 }
254 255
255 int GetCursorPositionX(int cursor_pos) { 256 int GetCursorPositionX(int cursor_pos) {
256 gfx::RenderText* render_text = textfield_view_->GetRenderText(); 257 gfx::RenderText* render_text = textfield_view_->GetRenderText();
257 return render_text->GetCursorBounds( 258 return render_text->GetCursorBounds(
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 #else 1555 #else
1555 EXPECT_EQ(500U, textfield_->GetCursorPosition()); 1556 EXPECT_EQ(500U, textfield_->GetCursorPosition());
1556 #endif 1557 #endif
1557 #endif // !defined(OS_WIN) 1558 #endif // !defined(OS_WIN)
1558 1559
1559 // Reset locale. 1560 // Reset locale.
1560 base::i18n::SetICUDefaultLocale(locale); 1561 base::i18n::SetICUDefaultLocale(locale);
1561 } 1562 }
1562 1563
1563 } // namespace views 1564 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/message_box_view.cc ('k') | ui/views/controls/textfield/native_textfield_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698