| Index: chrome/browser/instant/instant_controller.cc
|
| diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
|
| index 8187521fb0507526fe1d7a1e0b6b095ed9c8a5d8..3d1769a3afbdeca06d886e33074e935c2df7e5be 100644
|
| --- a/chrome/browser/instant/instant_controller.cc
|
| +++ b/chrome/browser/instant/instant_controller.cc
|
| @@ -201,8 +201,8 @@ InstantController::InstantController(chrome::BrowserInstantController* browser,
|
| last_transition_type_(content::PAGE_TRANSITION_LINK),
|
| last_match_was_search_(false),
|
| omnibox_focus_state_(OMNIBOX_FOCUS_NONE),
|
| - start_margin_(0),
|
| - end_margin_(0),
|
| + omnibox_start_margin_(0),
|
| + omnibox_width_(0),
|
| allow_preview_to_show_search_suggestions_(false) {
|
| }
|
|
|
| @@ -464,18 +464,19 @@ 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_ ||
|
| + (omnibox_start_margin_ == margin && omnibox_width_ == width))
|
| return;
|
|
|
| - start_margin_ = start;
|
| - end_margin_ = end;
|
| + omnibox_start_margin_ = margin;
|
| + omnibox_width_ = width;
|
| if (overlay_)
|
| - overlay_->SetMarginSize(start_margin_, end_margin_);
|
| + overlay_->SetStartMarginAndWidth(omnibox_start_margin_, omnibox_width_);
|
| if (ntp_)
|
| - ntp_->SetMarginSize(start_margin_, end_margin_);
|
| + ntp_->SetStartMarginAndWidth(omnibox_start_margin_, omnibox_width_);
|
| if (instant_tab_)
|
| - instant_tab_->SetMarginSize(start_margin_, end_margin_);
|
| + instant_tab_->SetStartMarginAndWidth(margin, width);
|
| }
|
|
|
| void InstantController::HandleAutocompleteResults(
|
| @@ -862,11 +863,11 @@ void InstantController::InstantPageRenderViewCreated(
|
| overlay_->SetDisplayInstantResults(instant_enabled_);
|
| overlay_->KeyCaptureChanged(
|
| omnibox_focus_state_ == OMNIBOX_FOCUS_INVISIBLE);
|
| - overlay_->SetMarginSize(start_margin_, end_margin_);
|
| + overlay_->SetStartMarginAndWidth(omnibox_start_margin_, omnibox_width_);
|
| overlay_->InitializeFonts();
|
| } else if (IsContentsFrom(ntp(), contents)) {
|
| ntp_->SetDisplayInstantResults(instant_enabled_);
|
| - ntp_->SetMarginSize(start_margin_, end_margin_);
|
| + ntp_->SetStartMarginAndWidth(omnibox_start_margin_, omnibox_width_);
|
| ntp_->InitializeFonts();
|
| } else {
|
| NOTREACHED();
|
| @@ -1174,7 +1175,8 @@ void InstantController::ResetInstantTab() {
|
| // Update theme info for this tab.
|
| browser_->UpdateThemeInfo(false);
|
| instant_tab_->SetDisplayInstantResults(instant_enabled_);
|
| - instant_tab_->SetMarginSize(start_margin_, end_margin_);
|
| + instant_tab_->SetStartMarginAndWidth(
|
| + omnibox_start_margin_, omnibox_width_);
|
| instant_tab_->InitializeFonts();
|
| instant_tab_->KeyCaptureChanged(
|
| omnibox_focus_state_ == OMNIBOX_FOCUS_INVISIBLE);
|
|
|