| 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/options2/clear_browser_data_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/clear_browser_data_handler2.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" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/browsing_data_helper.h" |
| 14 #include "chrome/browser/browsing_data_remover.h" |
| 13 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 16 #include "content/public/browser/notification_details.h" | 18 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/web_ui.h" | 19 #include "content/public/browser/web_ui.h" |
| 18 #include "grit/chromium_strings.h" | 20 #include "grit/chromium_strings.h" |
| 19 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 20 #include "grit/locale_settings.h" | 22 #include "grit/locale_settings.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 22 | 24 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // If we are still observing a previous data remover, we need to stop | 130 // If we are still observing a previous data remover, we need to stop |
| 129 // observing. | 131 // observing. |
| 130 if (remover_) | 132 if (remover_) |
| 131 remover_->RemoveObserver(this); | 133 remover_->RemoveObserver(this); |
| 132 | 134 |
| 133 // BrowsingDataRemover deletes itself when done. | 135 // BrowsingDataRemover deletes itself when done. |
| 134 remover_ = new BrowsingDataRemover(profile, | 136 remover_ = new BrowsingDataRemover(profile, |
| 135 static_cast<BrowsingDataRemover::TimePeriod>(period_selected), | 137 static_cast<BrowsingDataRemover::TimePeriod>(period_selected), |
| 136 base::Time()); | 138 base::Time()); |
| 137 remover_->AddObserver(this); | 139 remover_->AddObserver(this); |
| 138 remover_->Remove(remove_mask); | 140 remover_->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
| 139 } | 141 } |
| 140 | 142 |
| 141 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { | 143 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { |
| 142 // No need to remove ourselves as an observer as BrowsingDataRemover deletes | 144 // No need to remove ourselves as an observer as BrowsingDataRemover deletes |
| 143 // itself after we return. | 145 // itself after we return. |
| 144 remover_ = NULL; | 146 remover_ = NULL; |
| 145 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); | 147 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); |
| 146 } | 148 } |
| 147 | 149 |
| 148 } // namespace options2 | 150 } // namespace options2 |
| OLD | NEW |