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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 string16 GetClipboardText() const { | 252 string16 GetClipboardText() const { |
253 string16 text; | 253 string16 text; |
254 views::ViewsDelegate::views_delegate->GetClipboard()-> | 254 views::ViewsDelegate::views_delegate->GetClipboard()-> |
255 ReadText(ui::Clipboard::BUFFER_STANDARD, &text); | 255 ReadText(ui::Clipboard::BUFFER_STANDARD, &text); |
256 return text; | 256 return text; |
257 } | 257 } |
258 | 258 |
259 void SetClipboardText(const std::string& text) { | 259 void SetClipboardText(const std::string& text) { |
260 ui::ScopedClipboardWriter clipboard_writer( | 260 ui::ScopedClipboardWriter clipboard_writer( |
261 views::ViewsDelegate::views_delegate->GetClipboard()); | 261 views::ViewsDelegate::views_delegate->GetClipboard(), |
| 262 ui::Clipboard::BUFFER_STANDARD); |
262 clipboard_writer.WriteText(ASCIIToUTF16(text)); | 263 clipboard_writer.WriteText(ASCIIToUTF16(text)); |
263 } | 264 } |
264 | 265 |
265 View* GetFocusedView() { | 266 View* GetFocusedView() { |
266 return widget_->GetFocusManager()->GetFocusedView(); | 267 return widget_->GetFocusManager()->GetFocusedView(); |
267 } | 268 } |
268 | 269 |
269 int GetCursorPositionX(int cursor_pos) { | 270 int GetCursorPositionX(int cursor_pos) { |
270 gfx::RenderText* render_text = textfield_view_->GetRenderText(); | 271 gfx::RenderText* render_text = textfield_view_->GetRenderText(); |
271 return render_text->GetCursorBounds( | 272 return render_text->GetCursorBounds( |
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 #else | 1569 #else |
1569 EXPECT_EQ(500U, textfield_->GetCursorPosition()); | 1570 EXPECT_EQ(500U, textfield_->GetCursorPosition()); |
1570 #endif | 1571 #endif |
1571 #endif // !defined(OS_WIN) | 1572 #endif // !defined(OS_WIN) |
1572 | 1573 |
1573 // Reset locale. | 1574 // Reset locale. |
1574 base::i18n::SetICUDefaultLocale(locale); | 1575 base::i18n::SetICUDefaultLocale(locale); |
1575 } | 1576 } |
1576 | 1577 |
1577 } // namespace views | 1578 } // namespace views |
OLD | NEW |