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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |