OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/clear_browser_data_handler.h" | 5 #include "chrome/browser/ui/webui/options/clear_browser_data_handler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 : remover_(NULL) { | 34 : remover_(NULL) { |
35 } | 35 } |
36 | 36 |
37 ClearBrowserDataHandler::~ClearBrowserDataHandler() { | 37 ClearBrowserDataHandler::~ClearBrowserDataHandler() { |
38 if (remover_) | 38 if (remover_) |
39 remover_->RemoveObserver(this); | 39 remover_->RemoveObserver(this); |
40 } | 40 } |
41 | 41 |
42 void ClearBrowserDataHandler::InitializeHandler() { | 42 void ClearBrowserDataHandler::InitializeHandler() { |
43 clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled, | 43 clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled, |
44 Profile::FromWebUI(web_ui())->GetPrefs(), | 44 Profile::FromWebUI(web_ui())->GetPrefs()); |
45 NULL); | |
46 pepper_flash_settings_enabled_.Init(prefs::kPepperFlashSettingsEnabled, | 45 pepper_flash_settings_enabled_.Init(prefs::kPepperFlashSettingsEnabled, |
47 Profile::FromWebUI(web_ui())->GetPrefs(), | 46 Profile::FromWebUI(web_ui())->GetPrefs()); |
48 NULL); | |
49 } | 47 } |
50 | 48 |
51 void ClearBrowserDataHandler::GetLocalizedValues( | 49 void ClearBrowserDataHandler::GetLocalizedValues( |
52 DictionaryValue* localized_strings) { | 50 DictionaryValue* localized_strings) { |
53 DCHECK(localized_strings); | 51 DCHECK(localized_strings); |
54 | 52 |
55 static OptionsStringResource resources[] = { | 53 static OptionsStringResource resources[] = { |
56 { "clearBrowserDataLabel", IDS_CLEAR_BROWSING_DATA_LABEL }, | 54 { "clearBrowserDataLabel", IDS_CLEAR_BROWSING_DATA_LABEL }, |
57 { "deleteBrowsingHistoryCheckbox", IDS_DEL_BROWSING_HISTORY_CHKBOX }, | 55 { "deleteBrowsingHistoryCheckbox", IDS_DEL_BROWSING_HISTORY_CHKBOX }, |
58 { "deleteDownloadHistoryCheckbox", IDS_DEL_DOWNLOAD_HISTORY_CHKBOX }, | 56 { "deleteDownloadHistoryCheckbox", IDS_DEL_DOWNLOAD_HISTORY_CHKBOX }, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 155 } |
158 | 156 |
159 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { | 157 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { |
160 // No need to remove ourselves as an observer as BrowsingDataRemover deletes | 158 // No need to remove ourselves as an observer as BrowsingDataRemover deletes |
161 // itself after we return. | 159 // itself after we return. |
162 remover_ = NULL; | 160 remover_ = NULL; |
163 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); | 161 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); |
164 } | 162 } |
165 | 163 |
166 } // namespace options | 164 } // namespace options |
OLD | NEW |