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

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: 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..dc59404111b2b3a7ce67b999335beb093d72cb39 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,15 @@ int OmniboxResultView::GetAnswerLineHeight() const {
}
int OmniboxResultView::GetContentLineHeight() const {
+ const int kIconVerticalPad =
+ ui::MaterialDesignController::GetMode() ==
+ ui::MaterialDesignController::MATERIAL_HYBRID
+ ? 8
+ : 4;
Peter Kasting 2016/11/22 22:12:08 Nit: Shorter: using MD = ui::MaterialDesignCont
Evan Stade 2016/11/29 03:01:45 done (with slight adjustments)
+ 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(

Powered by Google App Engine
This is Rietveld 408576698