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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 9707001: Ash: Use new toolbar buttons, adjust spacing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/theme/theme_resources_standard.grd ('k') | chrome/browser/ui/views/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 9e00dad8beb7d31f395633f6f3c94e253125effc..e9da29246756c73476e1d25602caed315d90c25b 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -87,11 +87,37 @@ OmniboxViewViews* AsViews(OmniboxView* view) {
return static_cast<OmniboxViewViews*>(view);
}
+// Height of the location bar's round corner region.
+// TODO(jamescook): Update all Chrome platforms to use the new art and metrics
+// from Ash, crbug.com/118228
+#if defined(USE_ASH)
+const int kBorderRoundCornerHeight = 5;
+#else
+const int kBorderRoundCornerHeight = 6;
+#endif
+
+// Width of location bar's round corner region.
+#if defined(USE_ASH)
+const int kBorderRoundCornerWidth = 4;
+#else
+const int kBorderRoundCornerWidth = 5;
+#endif
+
+// Radius of the round corners inside the location bar.
+#if defined(USE_ASH)
+const int kBorderCornerRadius = 2;
+#endif
+
} // namespace
// static
+#if defined(USE_ASH)
+const int LocationBarView::kNormalHorizontalEdgeThickness = 2;
+const int LocationBarView::kVerticalEdgeThickness = 3;
+#else
const int LocationBarView::kNormalHorizontalEdgeThickness = 1;
const int LocationBarView::kVerticalEdgeThickness = 2;
+#endif // defined(USE_ASH)
const int LocationBarView::kItemPadding = 3;
const int LocationBarView::kIconInternalPadding = 2;
const int LocationBarView::kEdgeItemPadding = kItemPadding;
@@ -111,11 +137,6 @@ static const int kSelectedKeywordBackgroundImages[] = {
IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_R,
};
-// Height of the location bar's round corner region.
-static const int kBorderRoundCornerHeight = 6;
-// Width of location bar's round corner region.
-static const int kBorderRoundCornerWidth = 5;
-
// LocationBarView -----------------------------------------------------------
LocationBarView::LocationBarView(Browser* browser,
@@ -768,10 +789,15 @@ void LocationBarView::OnPaint(gfx::Canvas* canvas) {
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
paint.setAntiAlias(true);
+#if defined(USE_ASH)
+ // On Ash the omnibox uses smaller corners.
+ const SkScalar radius(SkIntToScalar(kBorderCornerRadius));
+#else
// The round corners of the omnibox match the round corners of the dropdown
// below, and all our other bubbles.
const SkScalar radius(SkIntToScalar(
views::BubbleBorder::GetCornerRadius()));
+#endif
bounds.Inset(kNormalHorizontalEdgeThickness, 0);
canvas->sk_canvas()->drawRoundRect(gfx::RectToSkRect(bounds), radius,
radius, paint);
« no previous file with comments | « chrome/app/theme/theme_resources_standard.grd ('k') | chrome/browser/ui/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698