| OLD | NEW |
| 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/prefs/pref_registry_syncable.h" | 9 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void BrowserInstantController::OpenURLInCurrentTab( | 232 void BrowserInstantController::OpenURLInCurrentTab( |
| 233 const GURL& url, | 233 const GURL& url, |
| 234 content::PageTransition transition) { | 234 content::PageTransition transition) { |
| 235 browser_->OpenURL(content::OpenURLParams(url, | 235 browser_->OpenURL(content::OpenURLParams(url, |
| 236 content::Referrer(), | 236 content::Referrer(), |
| 237 CURRENT_TAB, | 237 CURRENT_TAB, |
| 238 transition, | 238 transition, |
| 239 false)); | 239 false)); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void BrowserInstantController::SetMarginSize(int start, int end) { | 242 void BrowserInstantController::SetStartMarginAndWidth(int margin, int width) { |
| 243 instant_.SetMarginSize(start, end); | 243 instant_.SetStartMarginAndWidth(margin, width); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void BrowserInstantController::ResetInstant() { | 246 void BrowserInstantController::ResetInstant() { |
| 247 bool instant_enabled = IsInstantEnabled(profile()); | 247 bool instant_enabled = IsInstantEnabled(profile()); |
| 248 bool use_local_preview_only = profile()->IsOffTheRecord() || | 248 bool use_local_preview_only = profile()->IsOffTheRecord() || |
| 249 (!instant_enabled && | 249 (!instant_enabled && |
| 250 !profile()->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled)); | 250 !profile()->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled)); |
| 251 instant_.SetInstantEnabled(instant_enabled, use_local_preview_only); | 251 instant_.SetInstantEnabled(instant_enabled, use_local_preview_only); |
| 252 } | 252 } |
| 253 | 253 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // part of the image overlay should draw, 'cos the origin is top-left. | 364 // part of the image overlay should draw, 'cos the origin is top-left. |
| 365 if (!browser_->search_model()->mode().is_ntp() || | 365 if (!browser_->search_model()->mode().is_ntp() || |
| 366 theme_info_.theme_id.empty() || | 366 theme_info_.theme_id.empty() || |
| 367 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { | 367 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { |
| 368 return; | 368 return; |
| 369 } | 369 } |
| 370 instant_.ThemeAreaHeightChanged(theme_area_height_); | 370 instant_.ThemeAreaHeightChanged(theme_area_height_); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace chrome | 373 } // namespace chrome |
| OLD | NEW |