| 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/combobox/native_combobox_views.h" | 5 #include "views/controls/combobox/native_combobox_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 "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 SkPaint paint; | 287 SkPaint paint; |
| 288 paint.setStyle(SkPaint::kStrokeAndFill_Style); | 288 paint.setStyle(SkPaint::kStrokeAndFill_Style); |
| 289 paint.setColor(kTextColor); | 289 paint.setColor(kTextColor); |
| 290 paint.setAntiAlias(true); | 290 paint.setAntiAlias(true); |
| 291 gfx::Path path; | 291 gfx::Path path; |
| 292 path.incReserve(4); | 292 path.incReserve(4); |
| 293 path.moveTo(SkIntToScalar(tip_x), SkIntToScalar(tip_y)); | 293 path.moveTo(SkIntToScalar(tip_x), SkIntToScalar(tip_y)); |
| 294 path.lineTo(SkIntToScalar(tip_x + shift_x), SkIntToScalar(tip_y + shift_y)); | 294 path.lineTo(SkIntToScalar(tip_x + shift_x), SkIntToScalar(tip_y + shift_y)); |
| 295 path.lineTo(SkIntToScalar(tip_x - shift_x), SkIntToScalar(tip_y + shift_y)); | 295 path.lineTo(SkIntToScalar(tip_x - shift_x), SkIntToScalar(tip_y + shift_y)); |
| 296 path.close(); | 296 path.close(); |
| 297 canvas->AsCanvasSkia()->drawPath(path, paint); | 297 canvas->GetSkCanvas()->drawPath(path, paint); |
| 298 } | 298 } |
| 299 | 299 |
| 300 | 300 |
| 301 void NativeComboboxViews::PaintText(gfx::Canvas* canvas) { | 301 void NativeComboboxViews::PaintText(gfx::Canvas* canvas) { |
| 302 gfx::Insets insets = GetInsets(); | 302 gfx::Insets insets = GetInsets(); |
| 303 | 303 |
| 304 canvas->Save(); | 304 canvas->Save(); |
| 305 canvas->ClipRectInt(insets.left(), insets.top(), | 305 canvas->ClipRectInt(insets.left(), insets.top(), |
| 306 width() - insets.width(), height() - insets.height()); | 306 width() - insets.width(), height() - insets.height()); |
| 307 | 307 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 #if defined(USE_AURA) | 379 #if defined(USE_AURA) |
| 380 // static | 380 // static |
| 381 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( | 381 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( |
| 382 Combobox* combobox) { | 382 Combobox* combobox) { |
| 383 return new NativeComboboxViews(combobox); | 383 return new NativeComboboxViews(combobox); |
| 384 } | 384 } |
| 385 #endif | 385 #endif |
| 386 | 386 |
| 387 } // namespace views | 387 } // namespace views |
| OLD | NEW |