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

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

Issue 2523783002: Top Chrome MD cleanup - get rid of most of GetLayoutInsets. (Closed)
Patch Set: fix typo Created 4 years, 1 month 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/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 3e0b1c44bca89feab0e00744b9c987f969cd5f97..2a1fc5309e6f881a7c84dcd6ead9b849131af99a 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -30,6 +30,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/canvas.h"
@@ -687,10 +688,12 @@ int OmniboxResultView::GetAnswerLineHeight() const {
}
int OmniboxResultView::GetContentLineHeight() const {
+ using Md = ui::MaterialDesignController;
+ const int kIconVerticalPad = Md::GetMode() == Md::MATERIAL_HYBRID ? 8 : 4;
+ const int kTextVerticalPad = 3;
return std::max(
- LocationBarView::kIconWidth +
- GetLayoutInsets(OMNIBOX_DROPDOWN_ICON).height(),
- GetTextHeight() + GetLayoutInsets(OMNIBOX_DROPDOWN_TEXT).height());
+ LocationBarView::kIconWidth + 2 * kIconVerticalPad,
+ GetTextHeight() + 2 * kTextVerticalPad);
}
std::unique_ptr<gfx::RenderText> OmniboxResultView::CreateAnswerLine(
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc ('k') | chrome/browser/ui/views/toolbar/app_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698