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

Side by Side Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 12094073: Use an experiment value to set the instant_extended.enabled pref default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dear MAD 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
« no previous file with comments | « no previous file | chrome/browser/ui/search/search.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(PrefServiceSyncable* prefs) { 72 void BrowserInstantController::RegisterUserPrefs(PrefServiceSyncable* prefs) {
73 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false, 73 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false,
74 PrefServiceSyncable::SYNCABLE_PREF); 74 PrefServiceSyncable::SYNCABLE_PREF);
75 prefs->RegisterBooleanPref(prefs::kInstantExtendedEnabled, true, 75 prefs->RegisterBooleanPref(prefs::kInstantEnabled, false,
76 PrefServiceSyncable::SYNCABLE_PREF); 76 PrefServiceSyncable::SYNCABLE_PREF);
77 prefs->RegisterBooleanPref(prefs::kInstantEnabled, false, 77
78 search::InstantExtendedDefault instant_extended_default_setting =
79 search::GetInstantExtendedDefaultSetting();
80
81 bool instant_extended_value = true;
dhollowa 2013/01/31 21:47:19 How about using a switch here with no "default:" c
robertshield 2013/01/31 22:25:51 Done.
82 if (instant_extended_default_setting == search::INSTANT_FORCE_OFF)
83 instant_extended_value = false;
84 else if (instant_extended_default_setting == search::INSTANT_USE_EXISTING)
85 instant_extended_value = prefs->GetBoolean(prefs::kInstantEnabled);
86
87 prefs->RegisterBooleanPref(prefs::kInstantExtendedEnabled,
88 instant_extended_value,
78 PrefServiceSyncable::SYNCABLE_PREF); 89 PrefServiceSyncable::SYNCABLE_PREF);
79 } 90 }
80 91
81 bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition) { 92 bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition) {
82 // Unsupported dispositions. 93 // Unsupported dispositions.
83 if (disposition == NEW_BACKGROUND_TAB || disposition == NEW_WINDOW) 94 if (disposition == NEW_BACKGROUND_TAB || disposition == NEW_WINDOW)
84 return false; 95 return false;
85 96
86 // The omnibox currently doesn't use other dispositions, so we don't attempt 97 // 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 98 // to handle them. If you hit this DCHECK file a bug and I'll (sky) add
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // part of the image overlay should draw, 'cos the origin is top-left. 307 // part of the image overlay should draw, 'cos the origin is top-left.
297 if (!browser_->search_model()->mode().is_ntp() || 308 if (!browser_->search_model()->mode().is_ntp() ||
298 theme_info_.theme_id.empty() || 309 theme_info_.theme_id.empty() ||
299 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { 310 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) {
300 return; 311 return;
301 } 312 }
302 instant_.ThemeAreaHeightChanged(theme_area_height_); 313 instant_.ThemeAreaHeightChanged(theme_area_height_);
303 } 314 }
304 315
305 } // namespace chrome 316 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/search/search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698