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

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

Issue 12328054: Fix prefs registration for BrowserInstantController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sketch of solution. 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 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 2775f3c8c1b7a988ef5b05e00d715ece1f575498..5d3ec8b4a6065a04d5d09200b0af461a91eab22b 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -48,6 +48,7 @@
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_instant_controller.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/options/options_util.h"
@@ -416,6 +417,17 @@ void BrowserOptionsHandler::GetLocalizedValues(DictionaryValue* values) {
} else {
values->SetString("instant_enabled", "instant.enabled");
}
+ // This is needed because in the instant extended case,
+ // search::GetInstantExtendedDefaultSetting may say
+ // INSTANT_USE_EXISTING, which means use the current value of
+ // kInstantEnabled. See browser_options.js for where we set the
+ // checkbox to this value.
+ //
+ // We do this both in the instant extended case and in the regular
+ // case so that there is less difference between code paths.
+ values->SetBoolean("instant_starting_value",
+ chrome::BrowserInstantController::IsInstantEnabled(
+ Profile::FromWebUI(web_ui())));
Mattias Nissler (ping if slow) 2013/02/25 18:53:41 I think this is not needed, but you just have to f
values->SetString(
"instantPrefAndWarning",
l10n_util::GetStringFUTF16(instant_message_id, instant_learn_more_url));

Powered by Google App Engine
This is Rietveld 408576698