OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/google/google_brand.h" |
13 #include "chrome/browser/google/google_util.h" | 14 #include "chrome/browser/google/google_util.h" |
14 #include "chrome/browser/profile_resetter/automatic_profile_resetter.h" | 15 #include "chrome/browser/profile_resetter/automatic_profile_resetter.h" |
15 #include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h" | 16 #include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h" |
16 #include "chrome/browser/profile_resetter/brandcode_config_fetcher.h" | 17 #include "chrome/browser/profile_resetter/brandcode_config_fetcher.h" |
17 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" | 18 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" |
18 #include "chrome/browser/profile_resetter/profile_resetter.h" | 19 #include "chrome/browser/profile_resetter/profile_resetter.h" |
19 #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" | 20 #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" |
20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
22 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
23 #include "content/public/browser/user_metrics.h" | 24 #include "content/public/browser/user_metrics.h" |
24 #include "content/public/browser/web_ui.h" | 25 #include "content/public/browser/web_ui.h" |
25 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
26 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
27 | 28 |
28 namespace options { | 29 namespace options { |
29 | 30 |
30 ResetProfileSettingsHandler::ResetProfileSettingsHandler() | 31 ResetProfileSettingsHandler::ResetProfileSettingsHandler() |
31 : automatic_profile_resetter_(NULL), has_shown_confirmation_dialog_(false) { | 32 : automatic_profile_resetter_(NULL), has_shown_confirmation_dialog_(false) { |
32 google_util::GetBrand(&brandcode_); | 33 google_brand::GetBrand(&brandcode_); |
33 } | 34 } |
34 | 35 |
35 ResetProfileSettingsHandler::~ResetProfileSettingsHandler() {} | 36 ResetProfileSettingsHandler::~ResetProfileSettingsHandler() {} |
36 | 37 |
37 void ResetProfileSettingsHandler::InitializeHandler() { | 38 void ResetProfileSettingsHandler::InitializeHandler() { |
38 Profile* profile = Profile::FromWebUI(web_ui()); | 39 Profile* profile = Profile::FromWebUI(web_ui()); |
39 resetter_.reset(new ProfileResetter(profile)); | 40 resetter_.reset(new ProfileResetter(profile)); |
40 automatic_profile_resetter_ = | 41 automatic_profile_resetter_ = |
41 AutomaticProfileResetterFactory::GetForBrowserContext(profile); | 42 AutomaticProfileResetterFactory::GetForBrowserContext(profile); |
42 } | 43 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 Profile::FromWebUI(web_ui()), | 213 Profile::FromWebUI(web_ui()), |
213 *setting_snapshot_); | 214 *setting_snapshot_); |
214 base::DictionaryValue feedback_info; | 215 base::DictionaryValue feedback_info; |
215 feedback_info.Set("feedbackInfo", list.release()); | 216 feedback_info.Set("feedbackInfo", list.release()); |
216 web_ui()->CallJavascriptFunction( | 217 web_ui()->CallJavascriptFunction( |
217 "ResetProfileSettingsOverlay.setFeedbackInfo", | 218 "ResetProfileSettingsOverlay.setFeedbackInfo", |
218 feedback_info); | 219 feedback_info); |
219 } | 220 } |
220 | 221 |
221 } // namespace options | 222 } // namespace options |
OLD | NEW |