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

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: The Great Samarth Merge of 2013 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 void BrowserInstantController::OpenURLInCurrentTab( 228 void BrowserInstantController::OpenURLInCurrentTab(
229 const GURL& url, 229 const GURL& url,
230 content::PageTransition transition) { 230 content::PageTransition transition) {
231 browser_->OpenURL(content::OpenURLParams(url, 231 browser_->OpenURL(content::OpenURLParams(url,
232 content::Referrer(), 232 content::Referrer(),
233 CURRENT_TAB, 233 CURRENT_TAB,
234 transition, 234 transition,
235 false)); 235 false));
236 } 236 }
237 237
238 void BrowserInstantController::SetMarginSize(int start, int end) { 238 void BrowserInstantController::SetStartMarginAndWidth(int margin, int width) {
239 instant_.SetMarginSize(start, end); 239 instant_.SetStartMarginAndWidth(margin, width);
240 } 240 }
241 241
242 void BrowserInstantController::ResetInstant() { 242 void BrowserInstantController::ResetInstant() {
243 bool instant_enabled = IsInstantEnabled(profile()); 243 bool instant_enabled = IsInstantEnabled(profile());
244 bool use_local_preview_only = profile()->IsOffTheRecord() || 244 bool use_local_preview_only = profile()->IsOffTheRecord() ||
245 (!instant_enabled && 245 (!instant_enabled &&
246 !profile()->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled)); 246 !profile()->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled));
247 instant_.SetInstantEnabled(instant_enabled, use_local_preview_only); 247 instant_.SetInstantEnabled(instant_enabled, use_local_preview_only);
248 } 248 }
249 249
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 // part of the image overlay should draw, 'cos the origin is top-left. 360 // part of the image overlay should draw, 'cos the origin is top-left.
361 if (!browser_->search_model()->mode().is_ntp() || 361 if (!browser_->search_model()->mode().is_ntp() ||
362 theme_info_.theme_id.empty() || 362 theme_info_.theme_id.empty() ||
363 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { 363 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) {
364 return; 364 return;
365 } 365 }
366 instant_.ThemeAreaHeightChanged(theme_area_height_); 366 instant_.ThemeAreaHeightChanged(theme_area_height_);
367 } 367 }
368 368
369 } // namespace chrome 369 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698