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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 2075443002: Remove IconLabelView layout constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // For WinDDK ATL compatibility, these ATL headers must come first. 5 // For WinDDK ATL compatibility, these ATL headers must come first.
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #if defined(OS_WIN) 8 #if defined(OS_WIN)
9 #include <atlbase.h> // NOLINT 9 #include <atlbase.h> // NOLINT
10 #include <atlwin.h> // NOLINT 10 #include <atlwin.h> // NOLINT
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 // Pre-MD, normal icons are 19 px wide, while extension icons are 16 px wide. 647 // Pre-MD, normal icons are 19 px wide, while extension icons are 16 px wide.
648 // The code in IconLabelBubbleView::Layout() positions these icons in the 648 // The code in IconLabelBubbleView::Layout() positions these icons in the
649 // omnibox using ICON_LABEL_VIEW_TRAILING_PADDING, so we use that here as well 649 // omnibox using ICON_LABEL_VIEW_TRAILING_PADDING, so we use that here as well
650 // so the icons will line up. 650 // so the icons will line up.
651 // 651 //
652 // Technically we don't need the IsModeMaterial() check here, but it will make 652 // Technically we don't need the IsModeMaterial() check here, but it will make
653 // it easier to see that all this code is dead once we switch to MD. 653 // it easier to see that all this code is dead once we switch to MD.
654 int icon_x = start_x; 654 int icon_x = start_x;
655 if (!ui::MaterialDesignController::IsModeMaterial() && 655 if (!ui::MaterialDesignController::IsModeMaterial() &&
656 (icon.width() != default_icon_size_)) 656 (icon.width() != default_icon_size_))
657 icon_x += GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING); 657 icon_x += IconLabelBubbleView::kTrailingPaddingPreMD;
658 icon_bounds_.SetRect(icon_x, (GetContentLineHeight() - icon.height()) / 2, 658 icon_bounds_.SetRect(icon_x, (GetContentLineHeight() - icon.height()) / 2,
659 icon.width(), icon.height()); 659 icon.width(), icon.height());
660 660
661 const int text_x = start_x + default_icon_size_ + horizontal_padding; 661 const int text_x = start_x + default_icon_size_ + horizontal_padding;
662 int text_width = end_x - text_x; 662 int text_width = end_x - text_x;
663 663
664 if (match_.associated_keyword.get()) { 664 if (match_.associated_keyword.get()) {
665 const int max_kw_x = end_x - keyword_icon_->width(); 665 const int max_kw_x = end_x - keyword_icon_->width();
666 const int kw_x = animation_->CurrentValueBetween(max_kw_x, start_x); 666 const int kw_x = animation_->CurrentValueBetween(max_kw_x, start_x);
667 const int kw_text_x = kw_x + keyword_icon_->width() + horizontal_padding; 667 const int kw_text_x = kw_x + keyword_icon_->width() + horizontal_padding;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 832
833 int OmniboxResultView::StartMargin() const { 833 int OmniboxResultView::StartMargin() const {
834 return ui::MaterialDesignController::IsModeMaterial() ? 834 return ui::MaterialDesignController::IsModeMaterial() ?
835 model_->start_margin() : 0; 835 model_->start_margin() : 0;
836 } 836 }
837 837
838 int OmniboxResultView::EndMargin() const { 838 int OmniboxResultView::EndMargin() const {
839 return ui::MaterialDesignController::IsModeMaterial() ? 839 return ui::MaterialDesignController::IsModeMaterial() ?
840 model_->end_margin() : 0; 840 model_->end_margin() : 0;
841 } 841 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698