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

Side by Side Diff: ui/views/controls/textfield/native_textfield_win.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 "ui/views/controls/textfield/native_textfield_win.h" 5 #include "ui/views/controls/textfield/native_textfield_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 context_menu_->RunContextMenuAt(gfx::Point(p)); 525 context_menu_->RunContextMenuAt(gfx::Point(p));
526 } 526 }
527 527
528 void NativeTextfieldWin::OnCopy() { 528 void NativeTextfieldWin::OnCopy() {
529 if (textfield_->IsObscured()) 529 if (textfield_->IsObscured())
530 return; 530 return;
531 531
532 const string16 text(GetSelectedText()); 532 const string16 text(GetSelectedText());
533 if (!text.empty() && ViewsDelegate::views_delegate) { 533 if (!text.empty() && ViewsDelegate::views_delegate) {
534 ui::ScopedClipboardWriter scw( 534 ui::ScopedClipboardWriter scw(
535 ViewsDelegate::views_delegate->GetClipboard()); 535 ViewsDelegate::views_delegate->GetClipboard(),
536 ui::Clipboard::BUFFER_STANDARD);
536 scw.WriteText(text); 537 scw.WriteText(text);
537 } 538 }
538 } 539 }
539 540
540 void NativeTextfieldWin::OnCut() { 541 void NativeTextfieldWin::OnCut() {
541 if (textfield_->read_only() || textfield_->IsObscured()) 542 if (textfield_->read_only() || textfield_->IsObscured())
542 return; 543 return;
543 544
544 OnCopy(); 545 OnCopy();
545 546
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 1158
1158 // static 1159 // static
1159 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 1160 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
1160 Textfield* field) { 1161 Textfield* field) {
1161 if (views::Widget::IsPureViews()) 1162 if (views::Widget::IsPureViews())
1162 return new NativeTextfieldViews(field); 1163 return new NativeTextfieldViews(field);
1163 return new NativeTextfieldWin(field); 1164 return new NativeTextfieldWin(field);
1164 } 1165 }
1165 1166
1166 } // namespace views 1167 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views_unittest.cc ('k') | ui/views/controls/textfield/textfield_views_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698