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

Side by Side Diff: chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | Annotate | Revision Log
OLDNEW
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 LocationBarView::kItemPadding; 510 LocationBarView::kItemPadding;
511 int font_height = GetFontHeight(); 511 int font_height = GetFontHeight();
512 text_bounds_.SetRect(text_x, std::max(0, (height() - font_height) / 2), 512 text_bounds_.SetRect(text_x, std::max(0, (height() - font_height) / 2),
513 std::max(bounds().width() - text_x - LocationBarView::kEdgeItemPadding, 513 std::max(bounds().width() - text_x - LocationBarView::kEdgeItemPadding,
514 0), font_height); 514 0), font_height);
515 } 515 }
516 516
517 void AutocompleteResultView::OnPaint(gfx::Canvas* canvas) { 517 void AutocompleteResultView::OnPaint(gfx::Canvas* canvas) {
518 const ResultViewState state = GetState(); 518 const ResultViewState state = GetState();
519 if (state != NORMAL) 519 if (state != NORMAL)
520 canvas->AsCanvasSkia()->drawColor(GetColor(state, BACKGROUND)); 520 canvas->AsCanvasSkia()->skia_canvas()->drawColor(
521 GetColor(state, BACKGROUND));
521 522
522 // Paint the icon. 523 // Paint the icon.
523 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_), 524 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_),
524 icon_bounds_.y()); 525 icon_bounds_.y());
525 526
526 // Paint the text. 527 // Paint the text.
527 int x = GetMirroredXForRect(text_bounds_); 528 int x = GetMirroredXForRect(text_bounds_);
528 mirroring_context_->Initialize(x, text_bounds_.width()); 529 mirroring_context_->Initialize(x, text_bounds_.width());
529 PaintMatch(canvas, match_, x); 530 PaintMatch(canvas, match_, x);
530 } 531 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698