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

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 12047107: Change the SearchBox API from using the start/end margins of the location bar to using the start ma… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added test Created 7 years, 10 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/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index b7b0f1643ae1aeef9dc3b4f66006750eedaba246..2e4ea9ede3638de22c8e70b6defdb27dc349ef61 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -180,7 +180,7 @@ InstantController::InstantController(chrome::BrowserInstantController* browser,
last_match_was_search_(false),
omnibox_focus_state_(OMNIBOX_FOCUS_NONE),
start_margin_(0),
- end_margin_(0),
+ width_(0),
allow_preview_to_show_search_suggestions_(false) {
}
@@ -429,16 +429,16 @@ void InstantController::SetPopupBounds(const gfx::Rect& bounds) {
}
}
-void InstantController::SetMarginSize(int start, int end) {
- if (!extended_enabled_ || (start_margin_ == start && end_margin_ == end))
+void InstantController::SetStartMarginAndWidth(int margin, int width) {
+ if (!extended_enabled_ || (start_margin_ == margin && width_ == width))
return;
- start_margin_ = start;
- end_margin_ = end;
+ start_margin_ = margin;
+ width_ = width;
if (loader_)
- loader_->SetMarginSize(start_margin_, end_margin_);
+ loader_->SetStartMarginAndWidth(margin, width);
if (instant_tab_)
- instant_tab_->SetMarginSize(start_margin_, end_margin_);
+ instant_tab_->SetStartMarginAndWidth(margin, width);
}
void InstantController::HandleAutocompleteResults(
@@ -964,7 +964,7 @@ void InstantController::InstantLoaderRenderViewCreated() {
loader_->SetDisplayInstantResults(instant_enabled_);
loader_->SearchModeChanged(search_mode_);
loader_->KeyCaptureChanged(omnibox_focus_state_ == OMNIBOX_FOCUS_INVISIBLE);
- loader_->SetMarginSize(start_margin_, end_margin_);
+ loader_->SetStartMarginAndWidth(start_margin_, width_);
loader_->InitializeFonts();
}
@@ -1094,7 +1094,7 @@ void InstantController::ResetInstantTab() {
instant_tab_.reset(new InstantTab(this, active_tab));
instant_tab_->Init();
instant_tab_->SetDisplayInstantResults(instant_enabled_);
- instant_tab_->SetMarginSize(start_margin_, end_margin_);
+ instant_tab_->SetStartMarginAndWidth(start_margin_, width_);
instant_tab_->InitializeFonts();
}

Powered by Google App Engine
This is Rietveld 408576698