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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 2642893002: Adjust positioning of location bar icons. (Closed)
Patch Set: nits 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_result_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
index a91113692703a538094cd399bf96c4a9f21c8028..e1a09fbef66e58fdb0dcfc16440ee3385d838c9c 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -20,6 +20,7 @@
#include "base/i18n/bidi_line_iterator.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
+#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/location_bar/background_with_1_px_border.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h"
@@ -594,21 +595,21 @@ void OmniboxResultView::InitContentsRenderTextIfNecessary() const {
}
void OmniboxResultView::Layout() {
- constexpr int horizontal_padding = LocationBarView::kHorizontalPadding;
+ const int horizontal_padding =
+ GetLayoutConstant(LOCATION_BAR_ELEMENT_PADDING) +
+ LocationBarView::kIconInteriorPadding;
// The horizontal bounds we're given are the outside bounds, so we can match
// the omnibox border outline shape exactly in OnPaint(). We have to inset
// here to keep the icons lined up.
- constexpr int start_x =
- BackgroundWith1PxBorder::kLocationBarBorderThicknessDip +
- horizontal_padding;
+ const int start_x = BackgroundWith1PxBorder::kLocationBarBorderThicknessDip +
+ horizontal_padding;
const int end_x = width() - start_x;
const gfx::ImageSkia icon = GetIcon();
icon_bounds_.SetRect(start_x, (GetContentLineHeight() - icon.height()) / 2,
icon.width(), icon.height());
- constexpr int text_x =
- start_x + LocationBarView::kIconWidth + horizontal_padding;
+ const int text_x = start_x + LocationBarView::kIconWidth + horizontal_padding;
int text_width = end_x - text_x;
if (match_.associated_keyword.get()) {
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698