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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2914163004: Omnibox UI Experiments: Make suggestions dropdown match omnibox width. (Closed)
Patch Set: fix Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | components/omnibox/browser/omnibox_field_trial.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | components/omnibox/browser/omnibox_field_trial.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698