| 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 21 matching lines...) Expand all Loading... |
| 32 #include "url/gurl.h" | 32 #include "url/gurl.h" |
| 33 | 33 |
| 34 #if defined(ENABLE_PLUGINS) | 34 #if defined(ENABLE_PLUGINS) |
| 35 #include "chrome/browser/pepper_flash_settings_manager.h" | 35 #include "chrome/browser/pepper_flash_settings_manager.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
| 39 #include "chromeos/dbus/dbus_method_call_status.h" | 39 #include "chromeos/dbus/dbus_method_call_status.h" |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 43 #include "chrome/browser/android/webapps/webapp_registry.mojom.h" |
| 44 #endif |
| 45 |
| 42 class BrowsingDataRemoverFactory; | 46 class BrowsingDataRemoverFactory; |
| 43 class HostContentSettingsMap; | 47 class HostContentSettingsMap; |
| 44 class IOThread; | 48 class IOThread; |
| 45 class BrowsingDataFilterBuilder; | 49 class BrowsingDataFilterBuilder; |
| 46 class Profile; | 50 class Profile; |
| 47 | 51 |
| 48 namespace chrome_browser_net { | 52 namespace chrome_browser_net { |
| 49 class Predictor; | 53 class Predictor; |
| 50 } | 54 } |
| 51 | 55 |
| 52 namespace content { | 56 namespace content { |
| 53 class BrowserContext; | 57 class BrowserContext; |
| 54 class PluginDataRemover; | 58 class PluginDataRemover; |
| 55 class StoragePartition; | 59 class StoragePartition; |
| 56 } | 60 } |
| 57 | 61 |
| 58 namespace net { | 62 namespace net { |
| 59 class URLRequestContextGetter; | 63 class URLRequestContextGetter; |
| 60 } | 64 } |
| 61 | 65 |
| 62 #if BUILDFLAG(ANDROID_JAVA_UI) | |
| 63 class WebappRegistry; | |
| 64 #endif | |
| 65 | |
| 66 // BrowsingDataRemover is responsible for removing data related to browsing: | 66 // BrowsingDataRemover is responsible for removing data related to browsing: |
| 67 // visits in url database, downloads, cookies ... | 67 // visits in url database, downloads, cookies ... |
| 68 class BrowsingDataRemover : public KeyedService | 68 class BrowsingDataRemover : public KeyedService |
| 69 #if defined(ENABLE_PLUGINS) | 69 #if defined(ENABLE_PLUGINS) |
| 70 , public PepperFlashSettingsManager::Client | 70 , public PepperFlashSettingsManager::Client |
| 71 #endif | 71 #endif |
| 72 { | 72 { |
| 73 public: | 73 public: |
| 74 // Mask used for Remove. | 74 // Mask used for Remove. |
| 75 enum RemoveDataMask { | 75 enum RemoveDataMask { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 void AddObserver(Observer* observer); | 222 void AddObserver(Observer* observer); |
| 223 void RemoveObserver(Observer* observer); | 223 void RemoveObserver(Observer* observer); |
| 224 | 224 |
| 225 // Used for testing. | 225 // Used for testing. |
| 226 void OverrideStoragePartitionForTesting( | 226 void OverrideStoragePartitionForTesting( |
| 227 content::StoragePartition* storage_partition); | 227 content::StoragePartition* storage_partition); |
| 228 | 228 |
| 229 #if BUILDFLAG(ANDROID_JAVA_UI) | 229 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 230 void OverrideWebappRegistryForTesting( | 230 void OverrideWebappRegistryForTesting( |
| 231 std::unique_ptr<WebappRegistry> webapp_registry); | 231 mojom::WebappRegistryPtr webapp_registry); |
| 232 #endif | 232 #endif |
| 233 | 233 |
| 234 // Parameters of the last call are exposed to be used by tests. Removal and | 234 // Parameters of the last call are exposed to be used by tests. Removal and |
| 235 // origin type masks equal to -1 mean that no removal has ever been executed. | 235 // origin type masks equal to -1 mean that no removal has ever been executed. |
| 236 // TODO(msramek): If other consumers than tests are interested in this, | 236 // TODO(msramek): If other consumers than tests are interested in this, |
| 237 // consider returning them in OnBrowsingDataRemoverDone() callback. | 237 // consider returning them in OnBrowsingDataRemoverDone() callback. |
| 238 const base::Time& GetLastUsedBeginTime(); | 238 const base::Time& GetLastUsedBeginTime(); |
| 239 const base::Time& GetLastUsedEndTime(); | 239 const base::Time& GetLastUsedEndTime(); |
| 240 int GetLastUsedRemovalMask(); | 240 int GetLastUsedRemovalMask(); |
| 241 int GetLastUsedOriginTypeMask(); | 241 int GetLastUsedOriginTypeMask(); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 470 |
| 471 // Used if we need to clear history. | 471 // Used if we need to clear history. |
| 472 base::CancelableTaskTracker history_task_tracker_; | 472 base::CancelableTaskTracker history_task_tracker_; |
| 473 | 473 |
| 474 std::unique_ptr<TemplateURLService::Subscription> template_url_sub_; | 474 std::unique_ptr<TemplateURLService::Subscription> template_url_sub_; |
| 475 | 475 |
| 476 // We do not own this. | 476 // We do not own this. |
| 477 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 477 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
| 478 | 478 |
| 479 #if BUILDFLAG(ANDROID_JAVA_UI) | 479 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 480 // WebappRegistry makes calls across the JNI. In unit tests, the Java side is | 480 // WebappRegistry makes calls to Java using mojo. In unit tests, the Java side |
| 481 // not initialised, so the registry must be mocked out. | 481 // is not initialised, so the registry must be mocked out. |
| 482 std::unique_ptr<WebappRegistry> webapp_registry_; | 482 mojom::WebappRegistryPtr webapp_registry_; |
| 483 #endif | 483 #endif |
| 484 | 484 |
| 485 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; | 485 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; |
| 486 | 486 |
| 487 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 487 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 488 }; | 488 }; |
| 489 | 489 |
| 490 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 490 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |