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

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: Don't run test on Mac & Linux Created 7 years, 9 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 "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_web_ui.h" 9 #include "chrome/browser/extensions/extension_web_ui.h"
10 #include "chrome/browser/prefs/pref_registry_syncable.h" 10 #include "chrome/browser/prefs/pref_registry_syncable.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 const GURL& url, 241 const GURL& url,
242 content::PageTransition transition, 242 content::PageTransition transition,
243 WindowOpenDisposition disposition) { 243 WindowOpenDisposition disposition) {
244 browser_->OpenURL(content::OpenURLParams(url, 244 browser_->OpenURL(content::OpenURLParams(url,
245 content::Referrer(), 245 content::Referrer(),
246 disposition, 246 disposition,
247 transition, 247 transition,
248 false)); 248 false));
249 } 249 }
250 250
251 void BrowserInstantController::SetMarginSize(int start, int end) { 251 void BrowserInstantController::SetOmniboxBounds(const gfx::Rect& bounds) {
252 instant_.SetMarginSize(start, end); 252 instant_.SetOmniboxBounds(bounds);
253 } 253 }
254 254
255 void BrowserInstantController::ResetInstant() { 255 void BrowserInstantController::ResetInstant() {
256 bool instant_enabled = IsInstantEnabled(profile()); 256 bool instant_enabled = IsInstantEnabled(profile());
257 bool use_local_preview_only = profile()->IsOffTheRecord() || 257 bool use_local_preview_only = profile()->IsOffTheRecord() ||
258 (!instant_enabled && 258 (!instant_enabled &&
259 !profile()->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled)); 259 !profile()->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled));
260 instant_.SetInstantEnabled(instant_enabled, use_local_preview_only); 260 instant_.SetInstantEnabled(instant_enabled, use_local_preview_only);
261 } 261 }
262 262
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 initialized_theme_info_ = true; 360 initialized_theme_info_ = true;
361 } 361 }
362 362
363 DCHECK(initialized_theme_info_); 363 DCHECK(initialized_theme_info_);
364 364
365 if (browser_->search_model()->mode().is_ntp()) 365 if (browser_->search_model()->mode().is_ntp())
366 instant_.ThemeChanged(theme_info_); 366 instant_.ThemeChanged(theme_info_);
367 } 367 }
368 368
369 } // namespace chrome 369 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.h ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698