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

Side by Side Diff: chrome/browser/extensions/api/browsing_data/browsing_data_api.cc

Issue 10413072: Teaching BrowsingDataRemover how to delete application data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback. Created 8 years, 6 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
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 // Defines the Chrome Extensions BrowsingData API functions, which entail 5 // Defines the Chrome Extensions BrowsingData API functions, which entail
6 // clearing browsing data, and clearing the browser's cache (which, let's be 6 // clearing browsing data, and clearing the browser's cache (which, let's be
7 // honest, are the same thing), as specified in the extension API JSON. 7 // honest, are the same thing), as specified in the extension API JSON.
8 8
9 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" 9 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h"
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browsing_data_helper.h"
14 #include "chrome/browser/browsing_data_remover.h" 15 #include "chrome/browser/browsing_data_remover.h"
15 #include "chrome/browser/plugin_data_remover_helper.h" 16 #include "chrome/browser/plugin_data_remover_helper.h"
16 #include "chrome/browser/plugin_prefs.h" 17 #include "chrome/browser/plugin_prefs.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
19 #include "chrome/common/extensions/extension.h" 20 #include "chrome/common/extensions/extension.h"
20 #include "chrome/common/extensions/extension_error_utils.h" 21 #include "chrome/common/extensions/extension_error_utils.h"
21 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
22 23
23 using content::BrowserThread; 24 using content::BrowserThread;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone) 170 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone)
170 AddRef(); 171 AddRef();
171 172
172 // Create a BrowsingDataRemover, set the current object as an observer (so 173 // Create a BrowsingDataRemover, set the current object as an observer (so
173 // that we're notified after removal) and call remove() with the arguments 174 // that we're notified after removal) and call remove() with the arguments
174 // we've generated above. We can use a raw pointer here, as the browsing data 175 // we've generated above. We can use a raw pointer here, as the browsing data
175 // remover is responsible for deleting itself once data removal is complete. 176 // remover is responsible for deleting itself once data removal is complete.
176 BrowsingDataRemover* remover = new BrowsingDataRemover( 177 BrowsingDataRemover* remover = new BrowsingDataRemover(
177 GetCurrentBrowser()->profile(), remove_since_, base::Time::Now()); 178 GetCurrentBrowser()->profile(), remove_since_, base::Time::Now());
178 remover->AddObserver(this); 179 remover->AddObserver(this);
179 remover->Remove(removal_mask_); 180 remover->Remove(removal_mask_, BrowsingDataHelper::UNPROTECTED_WEB);
180 } 181 }
181 182
182 int RemoveBrowsingDataFunction::GetRemovalMask() const { 183 int RemoveBrowsingDataFunction::GetRemovalMask() const {
183 // Parse the |dataToRemove| argument to generate the removal mask. 184 // Parse the |dataToRemove| argument to generate the removal mask.
184 base::DictionaryValue* data_to_remove; 185 base::DictionaryValue* data_to_remove;
185 if (args_->GetDictionary(1, &data_to_remove)) 186 if (args_->GetDictionary(1, &data_to_remove))
186 return ParseRemovalMask(data_to_remove); 187 return ParseRemovalMask(data_to_remove);
187 else 188 else
188 return 0; 189 return 0;
189 } 190 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; 233 return BrowsingDataRemover::REMOVE_PLUGIN_DATA;
233 } 234 }
234 235
235 int RemovePasswordsFunction::GetRemovalMask() const { 236 int RemovePasswordsFunction::GetRemovalMask() const {
236 return BrowsingDataRemover::REMOVE_PASSWORDS; 237 return BrowsingDataRemover::REMOVE_PASSWORDS;
237 } 238 }
238 239
239 int RemoveWebSQLFunction::GetRemovalMask() const { 240 int RemoveWebSQLFunction::GetRemovalMask() const {
240 return BrowsingDataRemover::REMOVE_WEBSQL; 241 return BrowsingDataRemover::REMOVE_WEBSQL;
241 } 242 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698