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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 years, 2 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 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 if (mode_ == NORMAL) { 737 if (mode_ == NORMAL) {
738 SkPaint paint; 738 SkPaint paint;
739 paint.setColor(color); 739 paint.setColor(color);
740 paint.setStyle(SkPaint::kFill_Style); 740 paint.setStyle(SkPaint::kFill_Style);
741 paint.setAntiAlias(true); 741 paint.setAntiAlias(true);
742 // The round corners of the omnibox match the round corners of the dropdown 742 // The round corners of the omnibox match the round corners of the dropdown
743 // below, and all our other bubbles. 743 // below, and all our other bubbles.
744 const SkScalar radius(SkIntToScalar( 744 const SkScalar radius(SkIntToScalar(
745 views::BubbleBorder::GetCornerRadius())); 745 views::BubbleBorder::GetCornerRadius()));
746 bounds.Inset(kNormalHorizontalEdgeThickness, 0); 746 bounds.Inset(kNormalHorizontalEdgeThickness, 0);
747 canvas->AsCanvasSkia()->drawRoundRect(gfx::RectToSkRect(bounds), radius, 747 canvas->GetSkCanvas()->drawRoundRect(gfx::RectToSkRect(bounds), radius,
748 radius, paint); 748 radius, paint);
749 } else { 749 } else {
750 canvas->FillRectInt(color, bounds.x(), bounds.y(), bounds.width(), 750 canvas->FillRectInt(color, bounds.x(), bounds.y(), bounds.width(),
751 bounds.height()); 751 bounds.height());
752 } 752 }
753 753
754 if (show_focus_rect_ && HasFocus()) { 754 if (show_focus_rect_ && HasFocus()) {
755 gfx::Rect r = location_entry_view_->bounds(); 755 gfx::Rect r = location_entry_view_->bounds();
756 #if defined(OS_WIN) 756 #if defined(OS_WIN)
757 canvas->DrawFocusRect(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); 757 canvas->DrawFocusRect(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2);
758 #else 758 #else
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 !suggested_text_view_->GetText().empty(); 1270 !suggested_text_view_->GetText().empty();
1271 } 1271 }
1272 1272
1273 #if !defined(USE_AURA) 1273 #if !defined(USE_AURA)
1274 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { 1274 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() {
1275 CHECK(!views::Widget::IsPureViews()); 1275 CHECK(!views::Widget::IsPureViews());
1276 return static_cast<OmniboxViewWin*>(location_entry_.get()); 1276 return static_cast<OmniboxViewWin*>(location_entry_.get());
1277 } 1277 }
1278 #endif 1278 #endif
1279 #endif 1279 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698