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

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 period 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 e7fe891d037785a216f511784a1f225e4fbe5d8d..e01cff0d06fe967040e0df8559d1cf490def8800 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -159,7 +159,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,
@@ -292,7 +291,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);
@@ -302,7 +302,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_);
open_pdf_in_reader_view_ = new OpenPDFInReaderView(this);
@@ -738,6 +739,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;
@@ -848,13 +853,14 @@ void LocationBarView::Layout() {
}
}
- // Now the web intents button
+ // Now the web intents button.
if (web_intents_button_view_->visible()) {
offset += web_intents_button_view_->GetBuiltInHorizontalPadding();
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