summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 02:59:36 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 02:59:36 +0000
commit98dc01072fbbd8c93d387f4dba8b328a752b1c15 (patch)
treef58eb3d29ac4d1cb7324c648048e4e4369d00c22
parent0b5939222f9d18f407c2e28b916dcf5adc63640c (diff)
downloadchromium_src-98dc01072fbbd8c93d387f4dba8b328a752b1c15.zip
chromium_src-98dc01072fbbd8c93d387f4dba8b328a752b1c15.tar.gz
chromium_src-98dc01072fbbd8c93d387f4dba8b328a752b1c15.tar.bz2
Makes predictive with autocompleted text the default. I'm leaving the
three variants in though as I'm going to add to about:flags the ability to choose between them. Because of the time I'm doing the minimal set of changes for Mac and TBRing this. Rohit, could you clean it up when you have a chance? BUG=none TEST=none TBR=estade@chromium.org, rohitra@chromium.org Review URL: http://codereview.chromium.org/5373006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67658 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm7
-rw-r--r--chrome/browser/gtk/options/general_page_gtk.cc22
-rw-r--r--chrome/browser/instant/instant_controller.cc23
-rw-r--r--chrome/browser/ui/views/options/general_page_view.cc22
-rw-r--r--chrome/browser/ui/views/options/general_page_view.h1
-rw-r--r--chrome/common/pref_names.cc3
-rw-r--r--chrome/common/pref_names.h1
7 files changed, 13 insertions, 66 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index 1e556a8..7851ccc 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -1255,12 +1255,7 @@ enum { kHomepageNewTabPage, kHomepageURL };
NSInteger state = enabled ? NSOnState : NSOffState;
[instantCheckbox_ setState:state];
- NSString* title = @"";
- if (enabled) {
- title = [NSString stringWithFormat:@"[%d]",
- prefs_->GetInteger(prefs::kInstantType)];
- }
- [instantExperiment_ setStringValue:title];
+ [instantExperiment_ setStringValue:@""];
}
- (IBAction)learnMoreAboutInstant:(id)sender {
diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc
index 8d7931f..ca34c7f 100644
--- a/chrome/browser/gtk/options/general_page_gtk.cc
+++ b/chrome/browser/gtk/options/general_page_gtk.cc
@@ -203,20 +203,6 @@ void GeneralPageGtk::NotifyPrefChanged(const std::string* pref_name) {
instant_checkbox_) {
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(instant_checkbox_), instant_.GetValue());
- std::string description = l10n_util::GetStringUTF8(IDS_INSTANT_PREF);
- if (instant_.GetValue()) {
- description += " " +
- base::StringPrintf("[%d]", prefs->GetInteger(prefs::kInstantType));
- }
- gtk_button_set_label(GTK_BUTTON(instant_checkbox_), description.c_str());
-
- // Relies on knowledge of GTK+ internals to find the checkbox's label child
- // and then make the indent below match its vertical spacing.
- GtkWidget* instant_label = gtk_bin_get_child(GTK_BIN(instant_checkbox_));
- if (instant_label && GTK_IS_LABEL(instant_label)) {
- g_signal_connect(instant_label, "size-allocate",
- G_CALLBACK(OnInstantLabelSizeAllocateThunk), this);
- }
}
initializing_ = false;
@@ -421,6 +407,14 @@ GtkWidget* GeneralPageGtk::InitDefaultSearchGroup() {
G_CALLBACK(OnInstantToggledThunk), this);
gtk_box_pack_start(GTK_BOX(instant_vbox), instant_checkbox_, FALSE, FALSE, 0);
+ // Relies on knowledge of GTK+ internals to find the checkbox's label child
+ // and then make the indent below match its vertical spacing.
+ GtkWidget* instant_label = gtk_bin_get_child(GTK_BIN(instant_checkbox_));
+ if (instant_label && GTK_IS_LABEL(instant_label)) {
+ g_signal_connect(instant_label, "size-allocate",
+ G_CALLBACK(OnInstantLabelSizeAllocateThunk), this);
+ }
+
instant_indent_ = gtk_fixed_new();
GtkWidget* explanation_box = gtk_hbox_new(FALSE, 0);
GtkWidget* explanation = gtk_label_new((
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index d9653af..fcc55f9 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -56,7 +56,6 @@ void InstantController::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterBooleanPref(prefs::kInstantEnabled, false);
prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce, false);
prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, false);
- prefs->RegisterIntegerPref(prefs::kInstantType, 0);
PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo);
}
@@ -107,15 +106,6 @@ void InstantController::Enable(Profile* profile) {
if (!service)
return;
- // Randomly pick a type. We're doing this to get feedback as to which variant
- // folks prefer.
-#if defined(TOOLKIT_VIEWS)
- int max_type = LAST_TYPE;
-#else
- int max_type = VERBATIM_TYPE;
-#endif
- service->SetInteger(prefs::kInstantType,
- base::RandInt(static_cast<int>(FIRST_TYPE), max_type));
service->SetBoolean(prefs::kInstantEnabled, true);
service->SetBoolean(prefs::kInstantConfirmDialogShown, true);
service->SetInt64(prefs::kInstantEnabledTime,
@@ -532,17 +522,8 @@ bool InstantController::GetType(Profile* profile, Type* type) {
if (!prefs->GetBoolean(prefs::kInstantEnabled))
return false;
- int int_value = prefs->GetInteger(prefs::kInstantType);
- if (int_value < FIRST_TYPE || int_value > LAST_TYPE) {
- // Make sure the value is legal.
- int_value = FIRST_TYPE;
- }
-#if !defined(TOOLKIT_VIEWS)
- // PREDICTIVE_NO_AUTO_COMPLETE_TYPE only makes sense on views.
- if (int_value == PREDICTIVE_NO_AUTO_COMPLETE_TYPE)
- int_value = PREDICTIVE_TYPE;
-#endif
- *type = static_cast<Type>(int_value);
+ // PREDICTIVE_TYPE is the default if enabled via preferences.
+ *type = PREDICTIVE_TYPE;
return true;
}
diff --git a/chrome/browser/ui/views/options/general_page_view.cc b/chrome/browser/ui/views/options/general_page_view.cc
index 92f0970..e8a5457 100644
--- a/chrome/browser/ui/views/options/general_page_view.cc
+++ b/chrome/browser/ui/views/options/general_page_view.cc
@@ -9,7 +9,6 @@
#include "base/callback.h"
#include "base/message_loop.h"
#include "base/string16.h"
-#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_window.h"
@@ -215,7 +214,6 @@ GeneralPageView::GeneralPageView(Profile* profile)
default_search_group_(NULL),
default_search_manage_engines_button_(NULL),
instant_checkbox_(NULL),
- instant_type_label_(NULL),
instant_link_(NULL),
default_browser_group_(NULL),
default_browser_status_label_(NULL),
@@ -444,19 +442,8 @@ void GeneralPageView::NotifyPrefChanged(const std::string* pref_name) {
!show_home_button_.IsManaged());
}
- if (!pref_name || *pref_name == prefs::kInstantEnabled) {
- bool is_instant_enabled = prefs->GetBoolean(prefs::kInstantEnabled);
- instant_checkbox_->SetChecked(is_instant_enabled);
- if (is_instant_enabled) {
- instant_type_label_->SetText(
- L"[" +
- UTF8ToWide(
- base::IntToString(prefs->GetInteger(prefs::kInstantType))) +
- L"]");
- }
- instant_type_label_->SetVisible(is_instant_enabled);
- instant_type_label_->GetParent()->Layout();
- }
+ if (!pref_name || *pref_name == prefs::kInstantEnabled)
+ instant_checkbox_->SetChecked(prefs->GetBoolean(prefs::kInstantEnabled));
}
void GeneralPageView::HighlightGroup(OptionsGroup highlight_group) {
@@ -672,8 +659,6 @@ void GeneralPageView::InitDefaultSearchGroup() {
instant_checkbox_->SetMultiLine(false);
instant_checkbox_->set_listener(this);
- instant_type_label_ = new views::Label();
-
instant_link_ = new views::Link(l10n_util::GetString(IDS_LEARN_MORE));
instant_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
instant_link_->SetController(this);
@@ -697,8 +682,6 @@ void GeneralPageView::InitDefaultSearchGroup() {
column_set = layout->AddColumnSet(checkbox_column_view_set_id);
column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
GridLayout::USE_PREF, 0, 0);
- column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
- GridLayout::USE_PREF, 0, 0);
const int link_column_set_id = 2;
column_set = layout->AddColumnSet(link_column_set_id);
@@ -717,7 +700,6 @@ void GeneralPageView::InitDefaultSearchGroup() {
layout->StartRow(0, checkbox_column_view_set_id);
layout->AddView(instant_checkbox_);
- layout->AddView(instant_type_label_);
layout->AddPaddingRow(0, 0);
layout->StartRow(0, link_column_set_id);
diff --git a/chrome/browser/ui/views/options/general_page_view.h b/chrome/browser/ui/views/options/general_page_view.h
index 970896e..129fe5e 100644
--- a/chrome/browser/ui/views/options/general_page_view.h
+++ b/chrome/browser/ui/views/options/general_page_view.h
@@ -154,7 +154,6 @@ class GeneralPageView : public OptionsPageView,
views::NativeButton* default_search_manage_engines_button_;
scoped_ptr<SearchEngineListModel> default_search_engines_model_;
views::Checkbox* instant_checkbox_;
- views::Label* instant_type_label_;
views::Link* instant_link_;
// Controls for the Default Browser group
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index d7c039e..b43b59a 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -226,9 +226,6 @@ const char kInstantEnabledTime[] = "instant.enabled_time";
// that are used.
const char kInstantPromo[] = "instant.promo";
-// Type of instant. This is one of the enums defined in InstantController::TYPE.
-const char kInstantType[] = "instant.type";
-
#if defined(USE_NSS) || defined(USE_OPENSSL)
// Prefs for SSLConfigServicePref. Currently, these are only present on
// and used by NSS/OpenSSL using OSes.
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 89f1c47..621cbe3 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -84,7 +84,6 @@ extern const char kInstantEnabled[];
extern const char kInstantEnabledOnce[];
extern const char kInstantEnabledTime[];
extern const char kInstantPromo[];
-extern const char kInstantType[];
#if defined(USE_NSS) || defined(USE_OPENSSL)
extern const char kCertRevocationCheckingEnabled[];
extern const char kSSL2Enabled[];