| 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 "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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 BrowserInstantController::~BrowserInstantController() { | 63 BrowserInstantController::~BrowserInstantController() { |
| 64 browser_->search_model()->RemoveObserver(this); | 64 browser_->search_model()->RemoveObserver(this); |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool BrowserInstantController::IsInstantEnabled(Profile* profile) { | 67 bool BrowserInstantController::IsInstantEnabled(Profile* profile) { |
| 68 return profile && !profile->IsOffTheRecord() && profile->GetPrefs() && | 68 return profile && !profile->IsOffTheRecord() && profile->GetPrefs() && |
| 69 profile->GetPrefs()->GetBoolean(GetInstantPrefName(profile)); | 69 profile->GetPrefs()->GetBoolean(GetInstantPrefName(profile)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void BrowserInstantController::RegisterUserPrefs(PrefService* prefs) { | 72 void BrowserInstantController::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 73 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false, | 73 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false, |
| 74 PrefService::SYNCABLE_PREF); | 74 PrefServiceSyncable::SYNCABLE_PREF); |
| 75 prefs->RegisterBooleanPref(prefs::kInstantExtendedEnabled, true, | 75 prefs->RegisterBooleanPref(prefs::kInstantExtendedEnabled, true, |
| 76 PrefService::SYNCABLE_PREF); | 76 PrefServiceSyncable::SYNCABLE_PREF); |
| 77 prefs->RegisterBooleanPref(prefs::kInstantEnabled, false, | 77 prefs->RegisterBooleanPref(prefs::kInstantEnabled, false, |
| 78 PrefService::SYNCABLE_PREF); | 78 PrefServiceSyncable::SYNCABLE_PREF); |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition) { | 81 bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition) { |
| 82 // Unsupported dispositions. | 82 // Unsupported dispositions. |
| 83 if (disposition == NEW_BACKGROUND_TAB || disposition == NEW_WINDOW) | 83 if (disposition == NEW_BACKGROUND_TAB || disposition == NEW_WINDOW) |
| 84 return false; | 84 return false; |
| 85 | 85 |
| 86 // The omnibox currently doesn't use other dispositions, so we don't attempt | 86 // The omnibox currently doesn't use other dispositions, so we don't attempt |
| 87 // to handle them. If you hit this DCHECK file a bug and I'll (sky) add | 87 // to handle them. If you hit this DCHECK file a bug and I'll (sky) add |
| 88 // support for the new disposition. | 88 // support for the new disposition. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // part of the image overlay should draw, 'cos the origin is top-left. | 296 // part of the image overlay should draw, 'cos the origin is top-left. |
| 297 if (!browser_->search_model()->mode().is_ntp() || | 297 if (!browser_->search_model()->mode().is_ntp() || |
| 298 theme_info_.theme_id.empty() || | 298 theme_info_.theme_id.empty() || |
| 299 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { | 299 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { |
| 300 return; | 300 return; |
| 301 } | 301 } |
| 302 instant_.ThemeAreaHeightChanged(theme_area_height_); | 302 instant_.ThemeAreaHeightChanged(theme_area_height_); |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace chrome | 305 } // namespace chrome |
| OLD | NEW |