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

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

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 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
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar_button.cc ('k') | ui/views/corewm/tooltip.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 void Textfield::WriteDragDataForView(View* sender, 1083 void Textfield::WriteDragDataForView(View* sender,
1084 const gfx::Point& press_pt, 1084 const gfx::Point& press_pt,
1085 OSExchangeData* data) { 1085 OSExchangeData* data) {
1086 const base::string16& selected_text(GetSelectedText()); 1086 const base::string16& selected_text(GetSelectedText());
1087 data->SetString(selected_text); 1087 data->SetString(selected_text);
1088 Label label(selected_text, GetFontList()); 1088 Label label(selected_text, GetFontList());
1089 label.SetBackgroundColor(GetBackgroundColor()); 1089 label.SetBackgroundColor(GetBackgroundColor());
1090 label.SetSubpixelRenderingEnabled(false); 1090 label.SetSubpixelRenderingEnabled(false);
1091 gfx::Size size(label.GetPreferredSize()); 1091 gfx::Size size(label.GetPreferredSize());
1092 gfx::NativeView native_view = GetWidget()->GetNativeView(); 1092 gfx::NativeView native_view = GetWidget()->GetNativeView();
1093 gfx::Display display = gfx::Screen::GetScreenFor(native_view)-> 1093 gfx::Display display =
1094 GetDisplayNearestWindow(native_view); 1094 gfx::Screen::GetScreen()->GetDisplayNearestWindow(native_view);
1095 size.SetToMin(gfx::Size(display.size().width(), height())); 1095 size.SetToMin(gfx::Size(display.size().width(), height()));
1096 label.SetBoundsRect(gfx::Rect(size)); 1096 label.SetBoundsRect(gfx::Rect(size));
1097 scoped_ptr<gfx::Canvas> canvas( 1097 scoped_ptr<gfx::Canvas> canvas(
1098 GetCanvasForDragImage(GetWidget(), label.size())); 1098 GetCanvasForDragImage(GetWidget(), label.size()));
1099 label.SetEnabledColor(GetTextColor()); 1099 label.SetEnabledColor(GetTextColor());
1100 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 1100 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
1101 // Desktop Linux Aura does not yet support transparency in drag images. 1101 // Desktop Linux Aura does not yet support transparency in drag images.
1102 canvas->DrawColor(GetBackgroundColor()); 1102 canvas->DrawColor(GetBackgroundColor());
1103 #endif 1103 #endif
1104 label.Paint(ui::CanvasPainter(canvas.get(), 1.f).context()); 1104 label.Paint(ui::CanvasPainter(canvas.get(), 1.f).context());
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 RequestFocus(); 1893 RequestFocus();
1894 model_->MoveCursorTo(mouse); 1894 model_->MoveCursorTo(mouse);
1895 if (!selection_clipboard_text.empty()) { 1895 if (!selection_clipboard_text.empty()) {
1896 model_->InsertText(selection_clipboard_text); 1896 model_->InsertText(selection_clipboard_text);
1897 UpdateAfterChange(true, true); 1897 UpdateAfterChange(true, true);
1898 } 1898 }
1899 OnAfterUserAction(); 1899 OnAfterUserAction();
1900 } 1900 }
1901 1901
1902 } // namespace views 1902 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar_button.cc ('k') | ui/views/corewm/tooltip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698