| 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 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #if defined(ENABLE_PLUGINS) | 30 #if defined(ENABLE_PLUGINS) |
| 31 #include "chrome/browser/pepper_flash_settings_manager.h" | 31 #include "chrome/browser/pepper_flash_settings_manager.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 35 #include "chromeos/dbus/dbus_method_call_status.h" | 35 #include "chromeos/dbus/dbus_method_call_status.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 class BrowsingDataRemoverFactory; | 38 class BrowsingDataRemoverFactory; |
| 39 class OriginFilterBuilder; |
| 39 class IOThread; | 40 class IOThread; |
| 40 class Profile; | 41 class Profile; |
| 41 | 42 |
| 42 namespace chrome_browser_net { | 43 namespace chrome_browser_net { |
| 43 class Predictor; | 44 class Predictor; |
| 44 } | 45 } |
| 45 | 46 |
| 46 namespace content { | 47 namespace content { |
| 47 class BrowserContext; | 48 class BrowserContext; |
| 48 class PluginDataRemover; | 49 class PluginDataRemover; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // interface. | 241 // interface. |
| 241 static CallbackSubscription RegisterOnBrowsingDataRemovedCallback( | 242 static CallbackSubscription RegisterOnBrowsingDataRemovedCallback( |
| 242 const Callback& callback); | 243 const Callback& callback); |
| 243 | 244 |
| 244 // Removes the specified items related to browsing for all origins that match | 245 // Removes the specified items related to browsing for all origins that match |
| 245 // the provided |origin_type_mask| (see BrowsingDataHelper::OriginTypeMask). | 246 // the provided |origin_type_mask| (see BrowsingDataHelper::OriginTypeMask). |
| 246 void Remove(const TimeRange& time_range, | 247 void Remove(const TimeRange& time_range, |
| 247 int remove_mask, | 248 int remove_mask, |
| 248 int origin_type_mask); | 249 int origin_type_mask); |
| 249 | 250 |
| 251 |
| 252 // Removes the specified items related to browsing for all origins that match |
| 253 // the provided |origin_type_mask| (see BrowsingDataHelper::OriginTypeMask). |
| 254 // The |origin_filter| is used as a final filter for clearing operations. |
| 255 // TODO(dmurph): Support all backends with filter (crbug.com/589586). |
| 256 void RemoveWithFilter(const TimeRange& time_range, |
| 257 int remove_mask, |
| 258 int origin_type_mask, |
| 259 const OriginFilterBuilder& origin_filter); |
| 260 |
| 250 void AddObserver(Observer* observer); | 261 void AddObserver(Observer* observer); |
| 251 void RemoveObserver(Observer* observer); | 262 void RemoveObserver(Observer* observer); |
| 252 | 263 |
| 253 // Used for testing. | 264 // Used for testing. |
| 254 void OverrideStoragePartitionForTesting( | 265 void OverrideStoragePartitionForTesting( |
| 255 content::StoragePartition* storage_partition); | 266 content::StoragePartition* storage_partition); |
| 256 | 267 |
| 257 private: | 268 private: |
| 258 // The clear API needs to be able to toggle removing_ in order to test that | 269 // The clear API needs to be able to toggle removing_ in order to test that |
| 259 // only one BrowsingDataRemover instance can be called at a time. | 270 // only one BrowsingDataRemover instance can be called at a time. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 bool success) override; | 304 bool success) override; |
| 294 #endif | 305 #endif |
| 295 | 306 |
| 296 #if defined (OS_CHROMEOS) | 307 #if defined (OS_CHROMEOS) |
| 297 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status, | 308 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status, |
| 298 bool result); | 309 bool result); |
| 299 #endif | 310 #endif |
| 300 | 311 |
| 301 // Removes the specified items related to browsing for a specific host. If the | 312 // Removes the specified items related to browsing for a specific host. If the |
| 302 // provided |remove_url| is empty, data is removed for all origins; otherwise, | 313 // provided |remove_url| is empty, data is removed for all origins; otherwise, |
| 303 // it is restricted by origin (where implemented yet). The | 314 // it is restricted by the origin filter origin (where implemented yet). The |
| 304 // |origin_type_mask| parameter defines the set of origins from which data | 315 // |origin_type_mask| parameter defines the set of origins from which data |
| 305 // should be removed (protected, unprotected, or both). | 316 // should be removed (protected, unprotected, or both). |
| 306 // TODO(ttr314): Remove "(where implemented yet)" constraint above once | 317 // TODO(ttr314): Remove "(where implemented yet)" constraint above once |
| 307 // crbug.com/113621 is done. | 318 // crbug.com/113621 is done. |
| 319 // TODO(crbug.com/589586): Support all backends w/ origin filter. |
| 308 void RemoveImpl(const TimeRange& time_range, | 320 void RemoveImpl(const TimeRange& time_range, |
| 309 int remove_mask, | 321 int remove_mask, |
| 310 const GURL& remove_url, | 322 const OriginFilterBuilder& origin_filter, |
| 311 int origin_type_mask); | 323 int origin_type_mask); |
| 312 | 324 |
| 313 // Notifies observers and transitions to the idle state. | 325 // Notifies observers and transitions to the idle state. |
| 314 void Notify(); | 326 void Notify(); |
| 315 | 327 |
| 316 // Checks if we are all done, and if so, calls Notify(). | 328 // Checks if we are all done, and if so, calls Notify(). |
| 317 void NotifyIfDone(); | 329 void NotifyIfDone(); |
| 318 | 330 |
| 319 // Called when history deletion is done. | 331 // Called when history deletion is done. |
| 320 void OnHistoryDeletionDone(); | 332 void OnHistoryDeletionDone(); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 480 |
| 469 // We do not own this. | 481 // We do not own this. |
| 470 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 482 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
| 471 | 483 |
| 472 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; | 484 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; |
| 473 | 485 |
| 474 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 486 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 475 }; | 487 }; |
| 476 | 488 |
| 477 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 489 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |