Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| index 3603e712f0d65f4ad2d707fc789b944f2e1fcee7..5b654ff973887ad8235534cd290af03dce7041c3 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -7,6 +7,7 @@ |
| #include <algorithm> |
| #include <map> |
| +#include "base/feature_list.h" |
| #include "base/i18n/rtl.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| @@ -49,6 +50,7 @@ |
| #include "chrome/grit/chromium_strings.h" |
| #include "components/bookmarks/common/bookmark_pref_names.h" |
| #include "components/favicon/content/content_favicon_driver.h" |
| +#include "components/omnibox/browser/omnibox_field_trial.h" |
| #include "components/omnibox/browser/omnibox_popup_model.h" |
| #include "components/omnibox/browser/omnibox_popup_view.h" |
| #include "components/prefs/pref_service.h" |
| @@ -369,12 +371,16 @@ void LocationBarView::GetOmniboxPopupPositioningInfo( |
| int* left_margin, |
| int* right_margin, |
| int top_edge_overlap) { |
| - *top_left_screen_coord = gfx::Point(0, parent()->height() - top_edge_overlap); |
| + bool narrow_popup = |
| + base::FeatureList::IsEnabled(omnibox::kUIExperimentNarrowDropdown); |
| + |
| + *top_left_screen_coord = |
| + gfx::Point(narrow_popup ? x() : 0, parent()->height() - top_edge_overlap); |
| views::View::ConvertPointToScreen(parent(), top_left_screen_coord); |
| - *popup_width = parent()->width(); |
| - *left_margin = x(); |
| - *right_margin = *popup_width - bounds().right(); |
| + *popup_width = narrow_popup ? width() : parent()->width(); |
| + *left_margin = narrow_popup ? 0 : x(); |
| + *right_margin = narrow_popup ? 0 : *popup_width - bounds().right(); |
|
Peter Kasting
2017/06/09 02:17:53
Nit: Reading this, it felt a bit cryptic and error
tommycli
2017/06/09 16:26:51
Done.
|
| } |
| //////////////////////////////////////////////////////////////////////////////// |