| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 break; | 91 break; |
| 92 case 3: | 92 case 3: |
| 93 label_string = l10n_util::GetStringUTF16(IDS_CLEAR_DATA_4WEEKS); | 93 label_string = l10n_util::GetStringUTF16(IDS_CLEAR_DATA_4WEEKS); |
| 94 break; | 94 break; |
| 95 case 4: | 95 case 4: |
| 96 label_string = l10n_util::GetStringUTF16(IDS_CLEAR_DATA_EVERYTHING); | 96 label_string = l10n_util::GetStringUTF16(IDS_CLEAR_DATA_EVERYTHING); |
| 97 break; | 97 break; |
| 98 } | 98 } |
| 99 ListValue* option = new ListValue(); | 99 ListValue* option = new ListValue(); |
| 100 option->Append(Value::CreateIntegerValue(i)); | 100 option->Append(Value::CreateIntegerValue(i)); |
| 101 option->Append(Value::CreateStringValue(label_string)); | 101 option->Append(new base::StringValue(label_string)); |
| 102 time_list->Append(option); | 102 time_list->Append(option); |
| 103 } | 103 } |
| 104 localized_strings->Set("clearBrowserDataTimeList", time_list); | 104 localized_strings->Set("clearBrowserDataTimeList", time_list); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void ClearBrowserDataHandler::RegisterMessages() { | 107 void ClearBrowserDataHandler::RegisterMessages() { |
| 108 // Setup handlers specific to this panel. | 108 // Setup handlers specific to this panel. |
| 109 web_ui()->RegisterMessageCallback("performClearBrowserData", | 109 web_ui()->RegisterMessageCallback("performClearBrowserData", |
| 110 base::Bind(&ClearBrowserDataHandler::HandleClearBrowserData, | 110 base::Bind(&ClearBrowserDataHandler::HandleClearBrowserData, |
| 111 base::Unretained(this))); | 111 base::Unretained(this))); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { | 159 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { |
| 160 // No need to remove ourselves as an observer as BrowsingDataRemover deletes | 160 // No need to remove ourselves as an observer as BrowsingDataRemover deletes |
| 161 // itself after we return. | 161 // itself after we return. |
| 162 remover_ = NULL; | 162 remover_ = NULL; |
| 163 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); | 163 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace options | 166 } // namespace options |
| OLD | NEW |