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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 7337007: Introduce a field trial for Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix onchange handling Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 622b6e01874cb883facd3623b64b8d1070e65aea..9a541ee5fb2fb5abcbb3a7ce0668933f8f3aab89 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/custom_home_pages_table_model.h"
#include "chrome/browser/instant/instant_confirm_dialog.h"
#include "chrome/browser/instant/instant_controller.h"
+#include "chrome/browser/instant/instant_field_trial.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/session_startup_pref.h"
@@ -129,6 +130,9 @@ void BrowserOptionsHandler::RegisterMessages() {
web_ui_->RegisterMessageCallback(
"disableInstant",
NewCallback(this, &BrowserOptionsHandler::DisableInstant));
+ web_ui_->RegisterMessageCallback(
+ "getInstantFieldTrialStatus",
Sheridan Rawlins 2011/07/26 07:07:15 When you add messages here, you should update the
sreeram 2011/07/26 07:36:10 As discussed on IRC, these tests seem to be passin
+ NewCallback(this, &BrowserOptionsHandler::GetInstantFieldTrialStatus));
}
void BrowserOptionsHandler::Initialize() {
@@ -484,6 +488,13 @@ void BrowserOptionsHandler::DisableInstant(const ListValue* args) {
InstantController::Disable(web_ui_->GetProfile());
}
+void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) {
+ FundamentalValue enabled(
+ InstantFieldTrial::IsExperimentGroup(web_ui_->GetProfile()));
+ web_ui_->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus",
+ enabled);
+}
+
void BrowserOptionsHandler::OnResultChanged(bool default_match_changed) {
const AutocompleteResult& result = autocomplete_controller_->result();
ListValue suggestions;

Powered by Google App Engine
This is Rietveld 408576698