summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/webui')
-rw-r--r--chrome/browser/ui/webui/options/reset_profile_settings_handler.cc25
-rw-r--r--chrome/browser/ui/webui/options/reset_profile_settings_handler.h4
2 files changed, 20 insertions, 9 deletions
diff --git a/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc b/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc
index 975891b..a245bb8 100644
--- a/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc
@@ -114,7 +114,7 @@ void ResetProfileSettingsHandler::OnResetProfileSettingsDone() {
web_ui()->CallJavascriptFunction("ResetProfileSettingsOverlay.doneResetting");
if (setting_snapshot_) {
Profile* profile = Profile::FromWebUI(web_ui());
- ResettableSettingsSnapshot current_snapshot(profile);
+ ResettableSettingsSnapshot current_snapshot(profile, false);
int difference = setting_snapshot_->FindDifferentFields(current_snapshot);
if (difference) {
setting_snapshot_->Subtract(current_snapshot);
@@ -134,13 +134,10 @@ void ResetProfileSettingsHandler::OnResetProfileSettingsDone() {
}
void ResetProfileSettingsHandler::OnShowResetProfileDialog(
- const base::ListValue*) {
- base::DictionaryValue flashInfo;
- flashInfo.Set("feedbackInfo", GetReadableFeedback(
- Profile::FromWebUI(web_ui())));
- web_ui()->CallJavascriptFunction(
- "ResetProfileSettingsOverlay.setFeedbackInfo",
- flashInfo);
+ const base::ListValue* value) {
+ UpdateFeedbackUI(ResettableSettingsSnapshot::GetReadableFeedback(
+ Profile::FromWebUI(web_ui()),
+ base::Bind(&ResetProfileSettingsHandler::UpdateFeedbackUI, AsWeakPtr())));
if (automatic_profile_resetter_)
automatic_profile_resetter_->NotifyDidOpenWebUIResetDialog();
@@ -186,7 +183,8 @@ void ResetProfileSettingsHandler::ResetProfile(bool send_settings) {
default_settings.reset(new BrandcodedDefaultSettings);
// Save current settings if required.
setting_snapshot_.reset(send_settings ?
- new ResettableSettingsSnapshot(Profile::FromWebUI(web_ui())) : NULL);
+ new ResettableSettingsSnapshot(Profile::FromWebUI(web_ui()), true) :
+ NULL);
resetter_->Reset(
ProfileResetter::ALL,
default_settings.Pass(),
@@ -196,4 +194,13 @@ void ResetProfileSettingsHandler::ResetProfile(bool send_settings) {
UMA_HISTOGRAM_BOOLEAN("ProfileReset.SendFeedback", send_settings);
}
+void ResetProfileSettingsHandler::UpdateFeedbackUI(
+ scoped_ptr<base::ListValue> list) {
+ base::DictionaryValue feedback_info;
+ feedback_info.Set("feedbackInfo", list.release());
+ web_ui()->CallJavascriptFunction(
+ "ResetProfileSettingsOverlay.setFeedbackInfo",
+ feedback_info);
+}
+
} // namespace options
diff --git a/chrome/browser/ui/webui/options/reset_profile_settings_handler.h b/chrome/browser/ui/webui/options/reset_profile_settings_handler.h
index ab8766f..8914290 100644
--- a/chrome/browser/ui/webui/options/reset_profile_settings_handler.h
+++ b/chrome/browser/ui/webui/options/reset_profile_settings_handler.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/webui/options/options_ui.h"
@@ -60,6 +61,9 @@ class ResetProfileSettingsHandler
// gave his consent to upload broken settings to Google for analysis.
void ResetProfile(bool send_settings);
+ // Sets new values for the feedback area.
+ void UpdateFeedbackUI(scoped_ptr<base::ListValue> list);
+
// Destroyed with the Profile, thus it should outlive us. This will be NULL if
// the underlying profile is off-the-record (e.g. in Guest mode on Chrome OS).
AutomaticProfileResetter* automatic_profile_resetter_;