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

Unified Diff: ui/views/controls/textfield/textfield_views_model.cc

Issue 10911074: Change how ui::Clipboard is accessed so there's only one per thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix various windows compile failures. Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/textfield/textfield_views_model.cc
diff --git a/ui/views/controls/textfield/textfield_views_model.cc b/ui/views/controls/textfield/textfield_views_model.cc
index d51e417e874a6bdfaa55b2d4d019c5c8c90b8196..8787debbdbcebf1463c2ff4cc139c3386f44494a 100644
--- a/ui/views/controls/textfield/textfield_views_model.cc
+++ b/ui/views/controls/textfield/textfield_views_model.cc
@@ -511,7 +511,7 @@ bool TextfieldViewsModel::Redo() {
bool TextfieldViewsModel::Cut() {
if (!HasCompositionText() && HasSelection() && !render_text_->is_obscured()) {
ui::ScopedClipboardWriter(
- views::ViewsDelegate::views_delegate->GetClipboard(),
+ ui::Clipboard::GetForCurrentThread(),
ui::Clipboard::BUFFER_STANDARD).WriteText(GetSelectedText());
// A trick to let undo/redo handle cursor correctly.
// Undoing CUT moves the cursor to the end of the change rather
@@ -529,7 +529,7 @@ bool TextfieldViewsModel::Cut() {
bool TextfieldViewsModel::Copy() {
if (!HasCompositionText() && HasSelection() && !render_text_->is_obscured()) {
ui::ScopedClipboardWriter(
- views::ViewsDelegate::views_delegate->GetClipboard(),
+ ui::Clipboard::GetForCurrentThread(),
ui::Clipboard::BUFFER_STANDARD).WriteText(GetSelectedText());
return true;
}
@@ -538,7 +538,7 @@ bool TextfieldViewsModel::Copy() {
bool TextfieldViewsModel::Paste() {
string16 result;
- views::ViewsDelegate::views_delegate->GetClipboard()
+ ui::Clipboard::GetForCurrentThread()
->ReadText(ui::Clipboard::BUFFER_STANDARD, &result);
if (!result.empty()) {
InsertTextInternal(result, false);

Powered by Google App Engine
This is Rietveld 408576698