| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 void BrowsingDataExtensionFunction::StartRemoving() { | 177 void BrowsingDataExtensionFunction::StartRemoving() { |
| 178 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone) | 178 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone) |
| 179 AddRef(); | 179 AddRef(); |
| 180 | 180 |
| 181 // Create a BrowsingDataRemover, set the current object as an observer (so | 181 // Create a BrowsingDataRemover, set the current object as an observer (so |
| 182 // that we're notified after removal) and call remove() with the arguments | 182 // that we're notified after removal) and call remove() with the arguments |
| 183 // we've generated above. We can use a raw pointer here, as the browsing data | 183 // we've generated above. We can use a raw pointer here, as the browsing data |
| 184 // remover is responsible for deleting itself once data removal is complete. | 184 // remover is responsible for deleting itself once data removal is complete. |
| 185 BrowsingDataRemover* remover = new BrowsingDataRemover(profile(), | 185 BrowsingDataRemover* remover = BrowsingDataRemover::CreateForRange(profile(), |
| 186 remove_since_, base::Time::Now()); | 186 remove_since_, base::Time::Max()); |
| 187 remover->AddObserver(this); | 187 remover->AddObserver(this); |
| 188 remover->Remove(removal_mask_, origin_set_mask_); | 188 remover->Remove(removal_mask_, origin_set_mask_); |
| 189 } | 189 } |
| 190 | 190 |
| 191 int BrowsingDataExtensionFunction::ParseOriginSetMask( | 191 int BrowsingDataExtensionFunction::ParseOriginSetMask( |
| 192 const base::DictionaryValue& options) { | 192 const base::DictionaryValue& options) { |
| 193 // Parse the |options| dictionary to generate the origin set mask. Default to | 193 // Parse the |options| dictionary to generate the origin set mask. Default to |
| 194 // UNPROTECTED_WEB if the developer doesn't specify anything. | 194 // UNPROTECTED_WEB if the developer doesn't specify anything. |
| 195 int mask = BrowsingDataHelper::UNPROTECTED_WEB; | 195 int mask = BrowsingDataHelper::UNPROTECTED_WEB; |
| 196 | 196 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 281 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
| 282 } | 282 } |
| 283 | 283 |
| 284 int RemovePasswordsFunction::GetRemovalMask() const { | 284 int RemovePasswordsFunction::GetRemovalMask() const { |
| 285 return BrowsingDataRemover::REMOVE_PASSWORDS; | 285 return BrowsingDataRemover::REMOVE_PASSWORDS; |
| 286 } | 286 } |
| 287 | 287 |
| 288 int RemoveWebSQLFunction::GetRemovalMask() const { | 288 int RemoveWebSQLFunction::GetRemovalMask() const { |
| 289 return BrowsingDataRemover::REMOVE_WEBSQL; | 289 return BrowsingDataRemover::REMOVE_WEBSQL; |
| 290 } | 290 } |
| OLD | NEW |