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

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

Issue 2642893002: Adjust positioning of location bar icons. (Closed)
Patch Set: fix test Created 3 years, 11 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/content_setting_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
index 2c299389f4271b15e85c8cb0629b81e02e9edf51..6f00fbd6cf6f5cb7646daadc6e7d4d04d45f09ee 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
#include "chrome/browser/ui/content_settings/content_setting_image_model.h"
+#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/content_setting_bubble_contents.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/grit/theme_resources.h"
@@ -43,11 +44,9 @@ ContentSettingImageView::ContentSettingImageView(
pause_animation_state_(0.0),
bubble_view_(nullptr),
suppress_mouse_released_action_(false) {
+ set_next_element_interior_padding(LocationBarView::kIconInteriorPadding);
SetInkDropMode(InkDropMode::ON);
SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
- image()->SetHorizontalAlignment(base::i18n::IsRTL()
- ? views::ImageView::TRAILING
- : views::ImageView::LEADING);
image()->EnableCanvasFlippingForRTLUI(true);
label()->SetElideBehavior(gfx::NO_ELIDE);
label()->SetVisible(false);
@@ -163,7 +162,7 @@ SkColor ContentSettingImageView::GetTextColor() const {
bool ContentSettingImageView::ShouldShowLabel() const {
return (!IsShrinking() ||
(width() > (image()->GetPreferredSize().width() +
- 2 * LocationBarView::kHorizontalPadding))) &&
+ 2 * GetLayoutConstant(LOCATION_BAR_ELEMENT_PADDING)))) &&
(slide_animator_.is_animating() || pause_animation_);
}

Powered by Google App Engine
This is Rietveld 408576698