| Index: chrome/browser/ui/webui/options/reset_profile_settings_handler.cc
|
| 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 bcbada861b6dca6b882b72333bb0f41b989a32d8..aa45c5b934c3b4f2f8b469076087e58b092d840b 100644
|
| --- a/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc
|
| @@ -11,6 +11,8 @@
|
| #include "base/strings/string16.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/google/google_util.h"
|
| +#include "chrome/browser/profile_resetter/automatic_profile_resetter.h"
|
| +#include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h"
|
| #include "chrome/browser/profile_resetter/brandcode_config_fetcher.h"
|
| #include "chrome/browser/profile_resetter/brandcoded_default_settings.h"
|
| #include "chrome/browser/profile_resetter/profile_resetter.h"
|
| @@ -30,11 +32,17 @@ ResetProfileSettingsHandler::ResetProfileSettingsHandler() {
|
| }
|
|
|
| ResetProfileSettingsHandler::~ResetProfileSettingsHandler() {
|
| + // Will be ignored if it was already called in OnResetProfileSettingsDone.
|
| + automatic_profile_resetter_->NotifyDidCloseWebUIResetDialog(
|
| + false /*performed_reset*/);
|
| }
|
|
|
| void ResetProfileSettingsHandler::InitializeHandler() {
|
| Profile* profile = Profile::FromWebUI(web_ui());
|
| resetter_.reset(new ProfileResetter(profile));
|
| + automatic_profile_resetter_ =
|
| + AutomaticProfileResetterFactory::GetForBrowserContext(profile);
|
| + DCHECK(automatic_profile_resetter_);
|
| }
|
|
|
| void ResetProfileSettingsHandler::InitializePage() {
|
| @@ -100,10 +108,15 @@ void ResetProfileSettingsHandler::OnResetProfileSettingsDone() {
|
| setting_snapshot_->Subtract(current_snapshot);
|
| std::string report = SerializeSettingsReport(*setting_snapshot_,
|
| difference);
|
| - SendSettingsFeedback(report, profile, PROFILE_RESET_WEBUI);
|
| + bool is_reset_prompt_active =
|
| + automatic_profile_resetter_->IsResetPromptActive();
|
| + SendSettingsFeedback(report, profile, is_reset_prompt_active ?
|
| + PROFILE_RESET_PROMPT : PROFILE_RESET_WEBUI);
|
| }
|
| setting_snapshot_.reset();
|
| }
|
| + automatic_profile_resetter_->NotifyDidCloseWebUIResetDialog(
|
| + true /*performed_reset*/);
|
| }
|
|
|
| void ResetProfileSettingsHandler::OnShowResetProfileDialog(const ListValue*) {
|
| @@ -114,6 +127,8 @@ void ResetProfileSettingsHandler::OnShowResetProfileDialog(const ListValue*) {
|
| "ResetProfileSettingsOverlay.setFeedbackInfo",
|
| flashInfo);
|
|
|
| + automatic_profile_resetter_->NotifyDidOpenWebUIResetDialog();
|
| +
|
| if (brandcode_.empty())
|
| return;
|
| config_fetcher_.reset(new BrandcodeConfigFetcher(
|
|
|