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

Side by Side Diff: chrome/browser/ui/browser_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: Sync to r180728 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_instant_controller.h" 5 #include "chrome/browser/ui/browser_instant_controller.h"
6 6
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/themes/theme_service.h" 10 #include "chrome/browser/themes/theme_service.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void BrowserInstantController::OpenURLInCurrentTab( 185 void BrowserInstantController::OpenURLInCurrentTab(
186 const GURL& url, 186 const GURL& url,
187 content::PageTransition transition) { 187 content::PageTransition transition) {
188 browser_->OpenURL(content::OpenURLParams(url, 188 browser_->OpenURL(content::OpenURLParams(url,
189 content::Referrer(), 189 content::Referrer(),
190 CURRENT_TAB, 190 CURRENT_TAB,
191 transition, 191 transition,
192 false)); 192 false));
193 } 193 }
194 194
195 void BrowserInstantController::SetMarginSize(int start, int end) { 195 void BrowserInstantController::SetLocationBarMarginAndWidth(int margin,
196 instant_.SetMarginSize(start, end); 196 int width) {
197 instant_.SetLocationBarMarginAndWidth(margin, width);
197 } 198 }
198 199
199 void BrowserInstantController::ResetInstant() { 200 void BrowserInstantController::ResetInstant() {
200 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); 201 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile()));
201 } 202 }
202 203
203 //////////////////////////////////////////////////////////////////////////////// 204 ////////////////////////////////////////////////////////////////////////////////
204 // BrowserInstantController, search::SearchModelObserver implementation: 205 // BrowserInstantController, search::SearchModelObserver implementation:
205 206
206 void BrowserInstantController::ModeChanged(const search::Mode& old_mode, 207 void BrowserInstantController::ModeChanged(const search::Mode& old_mode,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // part of the image overlay should draw, 'cos the origin is top-left. 314 // part of the image overlay should draw, 'cos the origin is top-left.
314 if (!browser_->search_model()->mode().is_ntp() || 315 if (!browser_->search_model()->mode().is_ntp() ||
315 theme_info_.theme_id.empty() || 316 theme_info_.theme_id.empty() ||
316 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { 317 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) {
317 return; 318 return;
318 } 319 }
319 instant_.ThemeAreaHeightChanged(theme_area_height_); 320 instant_.ThemeAreaHeightChanged(theme_area_height_);
320 } 321 }
321 322
322 } // namespace chrome 323 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698