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

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: Don't run test on Mac & Linux 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
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/instant/instant_extended_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 9725d5e7648afeffbb90f68c9f51a95387b681d7..624e0810d6ef6b7212703afdfbfd8dfaffdfbb8a 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -203,8 +203,6 @@ 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),
allow_preview_to_show_search_suggestions_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
}
@@ -467,18 +465,17 @@ 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::SetOmniboxBounds(const gfx::Rect& bounds) {
+ if (!extended_enabled_ || omnibox_bounds_ == bounds)
return;
- start_margin_ = start;
- end_margin_ = end;
+ omnibox_bounds_ = bounds;
if (overlay_)
- overlay_->SetMarginSize(start_margin_, end_margin_);
+ overlay_->SetOmniboxBounds(omnibox_bounds_);
if (ntp_)
- ntp_->SetMarginSize(start_margin_, end_margin_);
+ ntp_->SetOmniboxBounds(omnibox_bounds_);
if (instant_tab_)
- instant_tab_->SetMarginSize(start_margin_, end_margin_);
+ instant_tab_->SetOmniboxBounds(omnibox_bounds_);
}
void InstantController::HandleAutocompleteResults(
@@ -896,11 +893,11 @@ void InstantController::InstantPageRenderViewCreated(
overlay_->SetDisplayInstantResults(instant_enabled_);
overlay_->KeyCaptureChanged(
omnibox_focus_state_ == OMNIBOX_FOCUS_INVISIBLE);
- overlay_->SetMarginSize(start_margin_, end_margin_);
+ overlay_->SetOmniboxBounds(omnibox_bounds_);
overlay_->InitializeFonts();
} else if (IsContentsFrom(ntp(), contents)) {
ntp_->SetDisplayInstantResults(instant_enabled_);
- ntp_->SetMarginSize(start_margin_, end_margin_);
+ ntp_->SetOmniboxBounds(omnibox_bounds_);
ntp_->InitializeFonts();
} else {
NOTREACHED();
@@ -1230,7 +1227,7 @@ 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_->SetOmniboxBounds(omnibox_bounds_);
instant_tab_->InitializeFonts();
StartListeningToMostVisitedChanges();
instant_tab_->KeyCaptureChanged(
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/instant/instant_extended_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698