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

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

Issue 10834279: Give request-to-act badges a grey background, and increase spacing to make it fit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add Views UI; clean up GTK Created 8 years, 4 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
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 8e9f3b367ce581707ff090ca0b069806793cbecd..8af51eafd68b4ff1a7a33b71428fc251d12b35d5 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -112,7 +112,7 @@ const int kBorderRoundCornerWidth = 4;
// Radius of the round corners inside the location bar.
const int kBorderCornerRadius = 2;
-const int kDesktopItemPadding = 3;
+const int kDesktopItemPadding = 9;
Peter Kasting 2012/08/24 23:08:28 Is increasing this for all items really the right
Jeffrey Yasskin 2012/08/29 00:37:50 Aaron asked for the extra spacing on the star in h
const int kDesktopEdgeItemPadding = kDesktopItemPadding;
const int kTouchItemPadding = 8;
@@ -915,6 +915,7 @@ void LocationBarView::OnPaint(gfx::Canvas* canvas) {
radius, paint);
if (action_box_button_view_)
PaintActionBoxBackground(canvas, bounds);
+ PaintPageActionBackgrounds(canvas);
} else {
canvas->FillRect(bounds, color);
}
@@ -1221,6 +1222,24 @@ void LocationBarView::PaintActionBoxBackground(gfx::Canvas* canvas,
action_box_button_view_->GetBorderColor());
}
+void LocationBarView::PaintPageActionBackgrounds(gfx::Canvas* canvas) {
+ for (size_t i = 0; i < page_action_views_.size(); ++i) {
Peter Kasting 2012/08/24 23:08:28 Nit: Since all you do with i is to get page_action
Jeffrey Yasskin 2012/08/29 00:37:50 Done.
+ gfx::Rect bounds = page_action_views_[i]->bounds();
+ int horizontal_padding = GetItemPadding() -
+ page_action_views_[i]->GetBuiltInHorizontalPadding();
+ // These offsets place the top and bottom edges on top of the darkest line
+ // in the location bar border, and the side edges on the pixels exactly
+ // between two page actions. If the border image changes, these offsets
+ // will have to change to match.
+ bounds.Inset(-horizontal_padding / 2, -1,
Peter Kasting 2012/08/24 23:08:28 Nit: Don't use -1s here. Split the kVerticalEdgeT
Jeffrey Yasskin 2012/08/29 00:37:50 In Views, the visible edge thickness is 1 on the t
+ -horizontal_padding / 2, -1);
+ ExtensionAction* action =
+ page_action_views_[i]->image_view()->page_action();
+ action->PaintBackground(canvas, bounds,
+ SessionID::IdForTab(GetTabContents()));
+ }
+}
+
std::string LocationBarView::GetClassName() const {
return kViewClassName;
}

Powered by Google App Engine
This is Rietveld 408576698