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 3af3994b971eb321042fc29d286d9bebb790268b..622b6e01874cb883facd3623b64b8d1070e65aea 100644 |
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc |
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc |
@@ -15,6 +15,7 @@ |
#include "chrome/browser/browser_process.h" |
#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/net/url_fixer_upper.h" |
#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/prefs/session_startup_pref.h" |
@@ -122,6 +123,12 @@ void BrowserOptionsHandler::RegisterMessages() { |
web_ui_->RegisterMessageCallback( |
"toggleShowBookmarksBar", |
NewCallback(this, &BrowserOptionsHandler::ToggleShowBookmarksBar)); |
+ web_ui_->RegisterMessageCallback( |
+ "enableInstant", |
+ NewCallback(this, &BrowserOptionsHandler::EnableInstant)); |
+ web_ui_->RegisterMessageCallback( |
+ "disableInstant", |
+ NewCallback(this, &BrowserOptionsHandler::DisableInstant)); |
} |
void BrowserOptionsHandler::Initialize() { |
@@ -469,6 +476,14 @@ void BrowserOptionsHandler::ToggleShowBookmarksBar(const ListValue* args) { |
NotificationService::NoDetails()); |
} |
+void BrowserOptionsHandler::EnableInstant(const ListValue* args) { |
+ InstantController::Enable(web_ui_->GetProfile()); |
+} |
+ |
+void BrowserOptionsHandler::DisableInstant(const ListValue* args) { |
+ InstantController::Disable(web_ui_->GetProfile()); |
+} |
+ |
void BrowserOptionsHandler::OnResultChanged(bool default_match_changed) { |
const AutocompleteResult& result = autocomplete_controller_->result(); |
ListValue suggestions; |