OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/textfield/native_textfield_views.h" | 5 #include "views/controls/textfield/native_textfield_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 }; | 982 }; |
983 SkPath path; | 983 SkPath path; |
984 path.addRoundRect(rect, corners); | 984 path.addRoundRect(rect, corners); |
985 SkPaint paint; | 985 SkPaint paint; |
986 paint.setStyle(SkPaint::kStroke_Style); | 986 paint.setStyle(SkPaint::kStroke_Style); |
987 paint.setFlags(SkPaint::kAntiAlias_Flag); | 987 paint.setFlags(SkPaint::kAntiAlias_Flag); |
988 // TODO(oshima): Copy what WebKit does for focused border. | 988 // TODO(oshima): Copy what WebKit does for focused border. |
989 paint.setColor(has_focus_ ? kFocusedBorderColor : kDefaultBorderColor); | 989 paint.setColor(has_focus_ ? kFocusedBorderColor : kDefaultBorderColor); |
990 paint.setStrokeWidth(SkIntToScalar(has_focus_ ? 2 : 1)); | 990 paint.setStrokeWidth(SkIntToScalar(has_focus_ ? 2 : 1)); |
991 | 991 |
992 canvas->AsCanvasSkia()->drawPath(path, paint); | 992 canvas->AsCanvasSkia()->skia_canvas()->drawPath(path, paint); |
993 } | 993 } |
994 | 994 |
995 void NativeTextfieldViews::TextfieldBorder::GetInsets(gfx::Insets* insets) const | 995 void NativeTextfieldViews::TextfieldBorder::GetInsets(gfx::Insets* insets) const |
996 { | 996 { |
997 *insets = insets_; | 997 *insets = insets_; |
998 } | 998 } |
999 | 999 |
1000 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 1000 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
1001 int left, | 1001 int left, |
1002 int bottom, | 1002 int bottom, |
1003 int right) { | 1003 int right) { |
1004 insets_.Set(top, left, bottom, right); | 1004 insets_.Set(top, left, bottom, right); |
1005 } | 1005 } |
1006 | 1006 |
1007 } // namespace views | 1007 } // namespace views |
OLD | NEW |