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

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

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase Created 3 years, 9 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
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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 } 1057 }
1058 1058
1059 //////////////////////////////////////////////////////////////////////////////// 1059 ////////////////////////////////////////////////////////////////////////////////
1060 // Textfield, DragController overrides: 1060 // Textfield, DragController overrides:
1061 1061
1062 void Textfield::WriteDragDataForView(View* sender, 1062 void Textfield::WriteDragDataForView(View* sender,
1063 const gfx::Point& press_pt, 1063 const gfx::Point& press_pt,
1064 OSExchangeData* data) { 1064 OSExchangeData* data) {
1065 const base::string16& selected_text(GetSelectedText()); 1065 const base::string16& selected_text(GetSelectedText());
1066 data->SetString(selected_text); 1066 data->SetString(selected_text);
1067 Label label(selected_text, GetFontList()); 1067 Label label(selected_text, {GetFontList()});
1068 label.SetBackgroundColor(GetBackgroundColor()); 1068 label.SetBackgroundColor(GetBackgroundColor());
1069 label.SetSubpixelRenderingEnabled(false); 1069 label.SetSubpixelRenderingEnabled(false);
1070 gfx::Size size(label.GetPreferredSize()); 1070 gfx::Size size(label.GetPreferredSize());
1071 gfx::NativeView native_view = GetWidget()->GetNativeView(); 1071 gfx::NativeView native_view = GetWidget()->GetNativeView();
1072 display::Display display = 1072 display::Display display =
1073 display::Screen::GetScreen()->GetDisplayNearestWindow(native_view); 1073 display::Screen::GetScreen()->GetDisplayNearestWindow(native_view);
1074 size.SetToMin(gfx::Size(display.size().width(), height())); 1074 size.SetToMin(gfx::Size(display.size().width(), height()));
1075 label.SetBoundsRect(gfx::Rect(size)); 1075 label.SetBoundsRect(gfx::Rect(size));
1076 label.SetEnabledColor(GetTextColor()); 1076 label.SetEnabledColor(GetTextColor());
1077 1077
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 cursor_blink_timer_.Stop(); 2095 cursor_blink_timer_.Stop();
2096 } 2096 }
2097 2097
2098 void Textfield::OnCursorBlinkTimerFired() { 2098 void Textfield::OnCursorBlinkTimerFired() {
2099 DCHECK(ShouldBlinkCursor()); 2099 DCHECK(ShouldBlinkCursor());
2100 cursor_view_.SetVisible(!cursor_view_.visible()); 2100 cursor_view_.SetVisible(!cursor_view_.visible());
2101 UpdateCursorViewPosition(); 2101 UpdateCursorViewPosition();
2102 } 2102 }
2103 2103
2104 } // namespace views 2104 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698