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

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

Issue 7396025: Refactor Instant web UI (chrome://settings page). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed estade's comments 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
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698