| 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 // 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 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone) | 169 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone) |
| 170 AddRef(); | 170 AddRef(); |
| 171 | 171 |
| 172 // Create a BrowsingDataRemover, set the current object as an observer (so | 172 // Create a BrowsingDataRemover, set the current object as an observer (so |
| 173 // that we're notified after removal) and call remove() with the arguments | 173 // 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 | 174 // 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. | 175 // remover is responsible for deleting itself once data removal is complete. |
| 176 BrowsingDataRemover* remover = new BrowsingDataRemover( | 176 BrowsingDataRemover* remover = new BrowsingDataRemover( |
| 177 GetCurrentBrowser()->profile(), remove_since_, base::Time::Now()); | 177 GetCurrentBrowser()->profile(), remove_since_, base::Time::Now()); |
| 178 remover->AddObserver(this); | 178 remover->AddObserver(this); |
| 179 remover->Remove(removal_mask_); | 179 remover->Remove(removal_mask_, |
| 180 BrowsingDataRemover::REMOVE_FROM_UNPROTECTED_ORIGINS); |
| 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 Loading... |
| 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 } |
| OLD | NEW |