Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/browser/ui/webui/options2/clear_browser_data_handler.cc

Issue 10830210: Fix crbug.com/140910 (BrowsingDataRemover not working). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More places fixed, added DCHECK and conversion to BrowsingDataRemover. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_handler.h" 5 #include "chrome/browser/ui/webui/options2/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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 remove_mask |= BrowsingDataRemover::REMOVE_CONTENT_LICENSES; 139 remove_mask |= BrowsingDataRemover::REMOVE_CONTENT_LICENSES;
140 if (prefs->GetBoolean(prefs::kDeleteHostedAppsData)) { 140 if (prefs->GetBoolean(prefs::kDeleteHostedAppsData)) {
141 remove_mask |= site_data_mask; 141 remove_mask |= site_data_mask;
142 origin_mask |= BrowsingDataHelper::PROTECTED_WEB; 142 origin_mask |= BrowsingDataHelper::PROTECTED_WEB;
143 } 143 }
144 144
145 // BrowsingDataRemover deletes itself when done. 145 // BrowsingDataRemover deletes itself when done.
146 int period_selected = prefs->GetInteger(prefs::kDeleteTimePeriod); 146 int period_selected = prefs->GetInteger(prefs::kDeleteTimePeriod);
147 remover_ = new BrowsingDataRemover(profile, 147 remover_ = new BrowsingDataRemover(profile,
148 static_cast<BrowsingDataRemover::TimePeriod>(period_selected), 148 static_cast<BrowsingDataRemover::TimePeriod>(period_selected),
149 base::Time()); 149 base::Time::Now());
150 remover_->AddObserver(this); 150 remover_->AddObserver(this);
151 remover_->Remove(remove_mask, origin_mask); 151 remover_->Remove(remove_mask, origin_mask);
152 } 152 }
153 153
154 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { 154 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() {
155 // No need to remove ourselves as an observer as BrowsingDataRemover deletes 155 // No need to remove ourselves as an observer as BrowsingDataRemover deletes
156 // itself after we return. 156 // itself after we return.
157 remover_ = NULL; 157 remover_ = NULL;
158 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); 158 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing");
159 } 159 }
160 160
161 } // namespace options2 161 } // namespace options2
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698