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

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

Issue 795933009: [AiS] for desktop, two lines and font sytles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed old function declaration; fixed reference to color macros Created 5 years, 9 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/omnibox/omnibox_popup_contents_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
index fe061f65a9c0175152fd9e6d013d990b650f4663..05a192d7b9e362bb198638fb566968dc4d1a4701 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/ui/omnibox/omnibox_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_result_view.h"
+#include "components/omnibox/omnibox_field_trial.h"
msw 2015/03/18 18:03:36 Why is this needed?
dschuyler 2015/03/18 19:16:48 It is not needed. This CL is old and has gone thr
#include "ui/base/theme_provider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
@@ -67,8 +68,7 @@ OmniboxPopupContentsView::OmniboxPopupContentsView(
ignore_mouse_drag_(false),
size_animation_(this),
left_margin_(0),
- right_margin_(0),
- outside_vertical_padding_(0) {
+ right_margin_(0) {
// The contents is owned by the LocationBarView.
set_owned_by_client();
@@ -115,10 +115,10 @@ gfx::Rect OmniboxPopupContentsView::GetPopupBounds() const {
void OmniboxPopupContentsView::LayoutChildren() {
gfx::Rect contents_rect = GetContentsBounds();
- contents_rect.Inset(left_margin_,
- views::NonClientFrameView::kClientEdgeThickness +
- outside_vertical_padding_,
- right_margin_, outside_vertical_padding_);
+ contents_rect.Inset(
+ left_margin_, views::NonClientFrameView::kClientEdgeThickness +
+ OmniboxResultView::kMinimumTextVerticalPadding,
+ right_margin_, OmniboxResultView::kMinimumTextVerticalPadding);
int top = contents_rect.y();
for (size_t i = 0; i < AutocompleteResult::kMaxMatches; ++i) {
View* v = child_at(i);
@@ -388,18 +388,11 @@ int OmniboxPopupContentsView::CalculatePopupHeight() {
// amount of space between the text and the popup border as there is in the
// interior between each row of text.
//
- // Discovering the exact amount of leading and padding around the font is
- // a bit tricky and platform-specific, but this computation seems to work in
- // practice.
- OmniboxResultView* result_view = result_view_at(0);
- outside_vertical_padding_ =
- (result_view->GetPreferredSize().height() -
- result_view->GetTextHeight());
-
+ // The * 2 accounts for vertical padding used at the top and bottom.
return popup_height +
- views::NonClientFrameView::kClientEdgeThickness + // Top border.
- outside_vertical_padding_ * 2 + // Padding.
- bottom_shadow_->height() - kBorderInterior; // Bottom border.
+ views::NonClientFrameView::kClientEdgeThickness + // Top border.
+ OmniboxResultView::kMinimumTextVerticalPadding * 2 + // Padding.
+ bottom_shadow_->height() - kBorderInterior; // Bottom border.
}
OmniboxResultView* OmniboxPopupContentsView::CreateResultView(

Powered by Google App Engine
This is Rietveld 408576698