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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 label_string = l10n_util::GetStringUTF16(IDS_CLEAR_DATA_EVERYTHING); | 133 label_string = l10n_util::GetStringUTF16(IDS_CLEAR_DATA_EVERYTHING); |
134 break; | 134 break; |
135 } | 135 } |
136 base::ListValue* option = new base::ListValue(); | 136 base::ListValue* option = new base::ListValue(); |
137 option->Append(new base::FundamentalValue(i)); | 137 option->Append(new base::FundamentalValue(i)); |
138 option->Append(new base::StringValue(label_string)); | 138 option->Append(new base::StringValue(label_string)); |
139 time_list->Append(option); | 139 time_list->Append(option); |
140 } | 140 } |
141 localized_strings->Set("clearBrowserDataTimeList", time_list); | 141 localized_strings->Set("clearBrowserDataTimeList", time_list); |
142 localized_strings->SetBoolean("showDeleteBrowsingHistoryCheckboxes", | 142 localized_strings->SetBoolean("showDeleteBrowsingHistoryCheckboxes", |
143 !Profile::FromWebUI(web_ui())->IsManaged()); | 143 !Profile::FromWebUI(web_ui())->IsSupervised()); |
144 } | 144 } |
145 | 145 |
146 void ClearBrowserDataHandler::RegisterMessages() { | 146 void ClearBrowserDataHandler::RegisterMessages() { |
147 // Setup handlers specific to this panel. | 147 // Setup handlers specific to this panel. |
148 web_ui()->RegisterMessageCallback("performClearBrowserData", | 148 web_ui()->RegisterMessageCallback("performClearBrowserData", |
149 base::Bind(&ClearBrowserDataHandler::HandleClearBrowserData, | 149 base::Bind(&ClearBrowserDataHandler::HandleClearBrowserData, |
150 base::Unretained(this))); | 150 base::Unretained(this))); |
151 } | 151 } |
152 | 152 |
153 void ClearBrowserDataHandler::HandleClearBrowserData( | 153 void ClearBrowserDataHandler::HandleClearBrowserData( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); | 214 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); |
215 } | 215 } |
216 | 216 |
217 void ClearBrowserDataHandler::OnBrowsingHistoryPrefChanged() { | 217 void ClearBrowserDataHandler::OnBrowsingHistoryPrefChanged() { |
218 web_ui()->CallJavascriptFunction( | 218 web_ui()->CallJavascriptFunction( |
219 "ClearBrowserDataOverlay.setAllowDeletingHistory", | 219 "ClearBrowserDataOverlay.setAllowDeletingHistory", |
220 base::FundamentalValue(*allow_deleting_browser_history_)); | 220 base::FundamentalValue(*allow_deleting_browser_history_)); |
221 } | 221 } |
222 | 222 |
223 } // namespace options | 223 } // namespace options |
OLD | NEW |