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

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

Issue 10917280: Fix up views web intents location bar decoration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add font info to constructor Created 8 years, 3 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 40311e634c4822420414babaa4b65c02311eca99..91195c6179a0881d6e4417c035902e35a039539c 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -158,7 +158,6 @@ static const int kSelectedKeywordBackgroundImages[] = {
IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_R,
};
-// TODO(gbillock): replace these with web-intents images when available.
static const int kWIBubbleBackgroundImages[] = {
IDR_OMNIBOX_WI_BUBBLE_BACKGROUND_L,
IDR_OMNIBOX_WI_BUBBLE_BACKGROUND_C,
@@ -290,7 +289,8 @@ void LocationBarView::Init(views::View* popup_parent_view) {
for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) {
ContentSettingImageView* content_blocked_view =
new ContentSettingImageView(static_cast<ContentSettingsType>(i),
- kCSBubbleBackgroundImages, this);
+ kCSBubbleBackgroundImages, this,
+ font_, GetColor(ToolbarModel::NONE, TEXT));
content_setting_views_.push_back(content_blocked_view);
AddChildView(content_blocked_view);
content_blocked_view->SetVisible(false);
@@ -300,7 +300,8 @@ void LocationBarView::Init(views::View* popup_parent_view) {
AddChildView(zoom_view_);
web_intents_button_view_ =
- new WebIntentsButtonView(this, kWIBubbleBackgroundImages);
+ new WebIntentsButtonView(this, kWIBubbleBackgroundImages,
+ font_, GetColor(ToolbarModel::NONE, TEXT));
AddChildView(web_intents_button_view_);
if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) {
@@ -720,6 +721,10 @@ void LocationBarView::Layout() {
if ((*i)->visible())
entry_width -= ((*i)->GetPreferredSize().width() + GetItemPadding());
}
+ if (web_intents_button_view_->visible()) {
+ entry_width -= web_intents_button_view_->GetPreferredSize().width() +
+ GetItemPadding();
+ }
// The gap between the edit and whatever is to its right is shortened.
entry_width += kEditInternalSpace;
@@ -826,7 +831,8 @@ void LocationBarView::Layout() {
int width = web_intents_button_view_->GetPreferredSize().width();
offset -= width;
web_intents_button_view_->SetBounds(
- offset, location_y, width, location_height);
+ offset, location_y + kBubbleVerticalPadding, width,
+ web_intents_button_view_->GetPreferredSize().height());
offset -= GetItemPadding() -
web_intents_button_view_->GetBuiltInHorizontalPadding();
}

Powered by Google App Engine
This is Rietveld 408576698