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 // For WinDDK ATL compatibility, these ATL headers must come first. | 5 // For WinDDK ATL compatibility, these ATL headers must come first. |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <atlbase.h> // NOLINT | 8 #include <atlbase.h> // NOLINT |
9 #include <atlwin.h> // NOLINT | 9 #include <atlwin.h> // NOLINT |
10 #endif | 10 #endif |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 LocationBarView::kItemPadding; | 515 LocationBarView::kItemPadding; |
516 int text_height = GetTextHeight(); | 516 int text_height = GetTextHeight(); |
517 text_bounds_.SetRect(text_x, std::max(0, (height() - text_height) / 2), | 517 text_bounds_.SetRect(text_x, std::max(0, (height() - text_height) / 2), |
518 std::max(bounds().width() - text_x - LocationBarView::kEdgeItemPadding, | 518 std::max(bounds().width() - text_x - LocationBarView::kEdgeItemPadding, |
519 0), text_height); | 519 0), text_height); |
520 } | 520 } |
521 | 521 |
522 void AutocompleteResultView::OnPaint(gfx::Canvas* canvas) { | 522 void AutocompleteResultView::OnPaint(gfx::Canvas* canvas) { |
523 const ResultViewState state = GetState(); | 523 const ResultViewState state = GetState(); |
524 if (state != NORMAL) | 524 if (state != NORMAL) |
525 canvas->AsCanvasSkia()->drawColor(GetColor(state, BACKGROUND)); | 525 canvas->GetSkCanvas()->drawColor(GetColor(state, BACKGROUND)); |
526 | 526 |
527 // Paint the icon. | 527 // Paint the icon. |
528 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_), | 528 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_), |
529 icon_bounds_.y()); | 529 icon_bounds_.y()); |
530 | 530 |
531 // Paint the text. | 531 // Paint the text. |
532 int x = GetMirroredXForRect(text_bounds_); | 532 int x = GetMirroredXForRect(text_bounds_); |
533 mirroring_context_->Initialize(x, text_bounds_.width()); | 533 mirroring_context_->Initialize(x, text_bounds_.width()); |
534 PaintMatch(canvas, match_, x); | 534 PaintMatch(canvas, match_, x); |
535 } | 535 } |
OLD | NEW |