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

Side by Side Diff: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h

Issue 2637043002: Move plugins to ChromeBrowsingDataRemoverDelegate. (Closed)
Patch Set: Rebase. Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_
6 #define CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 11 matching lines...) Expand all
22 #include "ppapi/features/features.h" 22 #include "ppapi/features/features.h"
23 23
24 #if BUILDFLAG(ENABLE_PLUGINS) 24 #if BUILDFLAG(ENABLE_PLUGINS)
25 #include "chrome/browser/pepper_flash_settings_manager.h" 25 #include "chrome/browser/pepper_flash_settings_manager.h"
26 #endif 26 #endif
27 27
28 #if defined(OS_CHROMEOS) 28 #if defined(OS_CHROMEOS)
29 #include "chromeos/dbus/dbus_method_call_status.h" 29 #include "chromeos/dbus/dbus_method_call_status.h"
30 #endif 30 #endif
31 31
32 class BrowsingDataFlashLSOHelper;
32 class Profile; 33 class Profile;
33 class WebappRegistry; 34 class WebappRegistry;
34 35
35 namespace content { 36 namespace content {
36 class BrowserContext; 37 class BrowserContext;
38 class PluginDataRemover;
37 } 39 }
38 40
39 // A delegate used by BrowsingDataRemover to delete data specific to Chrome 41 // A delegate used by BrowsingDataRemover to delete data specific to Chrome
40 // as the embedder. 42 // as the embedder.
41 class ChromeBrowsingDataRemoverDelegate : public BrowsingDataRemoverDelegate 43 class ChromeBrowsingDataRemoverDelegate : public BrowsingDataRemoverDelegate
42 #if BUILDFLAG(ENABLE_PLUGINS) 44 #if BUILDFLAG(ENABLE_PLUGINS)
43 , public PepperFlashSettingsManager::Client 45 , public PepperFlashSettingsManager::Client
44 #endif 46 #endif
45 { 47 {
46 public: 48 public:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 int remove_mask, 82 int remove_mask,
81 const BrowsingDataFilterBuilder& filter_builder, 83 const BrowsingDataFilterBuilder& filter_builder,
82 int origin_type_mask, 84 int origin_type_mask,
83 const base::Closure& callback) override; 85 const base::Closure& callback) override;
84 86
85 #if defined(OS_ANDROID) 87 #if defined(OS_ANDROID)
86 void OverrideWebappRegistryForTesting( 88 void OverrideWebappRegistryForTesting(
87 std::unique_ptr<WebappRegistry> webapp_registry); 89 std::unique_ptr<WebappRegistry> webapp_registry);
88 #endif 90 #endif
89 91
92 #if BUILDFLAG(ENABLE_PLUGINS)
93 // Used for testing.
94 void OverrideFlashLSOHelperForTesting(
95 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper);
96 #endif
97
90 private: 98 private:
91 // If AllDone(), calls the callback provided in RemoveEmbedderData(). 99 // If AllDone(), calls the callback provided in RemoveEmbedderData().
92 void NotifyIfDone(); 100 void NotifyIfDone();
93 101
94 // Whether there are no running deletion tasks. 102 // Whether there are no running deletion tasks.
95 bool AllDone(); 103 bool AllDone();
96 104
97 // Callback for when TemplateURLService has finished loading. Clears the data, 105 // Callback for when TemplateURLService has finished loading. Clears the data,
98 // clears the respective waiting flag, and invokes NotifyIfDone. 106 // clears the respective waiting flag, and invokes NotifyIfDone.
99 void OnKeywordsLoaded(base::Callback<bool(const GURL&)> url_filter); 107 void OnKeywordsLoaded(base::Callback<bool(const GURL&)> url_filter);
100 108
101 #if defined (OS_CHROMEOS) 109 #if defined (OS_CHROMEOS)
102 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status, 110 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status,
103 bool result); 111 bool result);
104 #endif 112 #endif
105 113
106 // Callback for when cookies have been deleted. Invokes NotifyIfDone. 114 // Callback for when cookies have been deleted. Invokes NotifyIfDone.
107 void OnClearedCookies(); 115 void OnClearedCookies();
108 116
109 #if BUILDFLAG(ENABLE_PLUGINS) 117 #if BUILDFLAG(ENABLE_PLUGINS)
118 // Called when plugin data has been cleared. Invokes NotifyIfDone.
119 void OnWaitableEventSignaled(base::WaitableEvent* waitable_event);
120
121 // Called when the list of |sites| storing Flash LSO cookies is fetched.
122 void OnSitesWithFlashDataFetched(
123 base::Callback<bool(const std::string&)> plugin_filter,
124 const std::vector<std::string>& sites);
125
126 // Indicates that LSO cookies for one website have been deleted.
127 void OnFlashDataDeleted();
128
110 // PepperFlashSettingsManager::Client implementation. 129 // PepperFlashSettingsManager::Client implementation.
111 void OnDeauthorizeFlashContentLicensesCompleted(uint32_t request_id, 130 void OnDeauthorizeFlashContentLicensesCompleted(uint32_t request_id,
112 bool success) override; 131 bool success) override;
113 #endif 132 #endif
114 133
115 // The profile for which the data will be deleted. 134 // The profile for which the data will be deleted.
116 Profile* profile_; 135 Profile* profile_;
117 136
118 // Start time to delete from. 137 // Start time to delete from.
119 base::Time delete_begin_; 138 base::Time delete_begin_;
(...skipping 25 matching lines...) Expand all
145 SubTask clear_network_predictor_; 164 SubTask clear_network_predictor_;
146 SubTask clear_networking_history_; 165 SubTask clear_networking_history_;
147 SubTask clear_passwords_; 166 SubTask clear_passwords_;
148 SubTask clear_passwords_stats_; 167 SubTask clear_passwords_stats_;
149 SubTask clear_http_auth_cache_; 168 SubTask clear_http_auth_cache_;
150 SubTask clear_platform_keys_; 169 SubTask clear_platform_keys_;
151 #if defined(OS_ANDROID) 170 #if defined(OS_ANDROID)
152 SubTask clear_precache_history_; 171 SubTask clear_precache_history_;
153 SubTask clear_offline_page_data_; 172 SubTask clear_offline_page_data_;
154 #endif 173 #endif
155
156 #if BUILDFLAG(ENABLE_WEBRTC) 174 #if BUILDFLAG(ENABLE_WEBRTC)
157 SubTask clear_webrtc_logs_; 175 SubTask clear_webrtc_logs_;
158 #endif 176 #endif
159 SubTask clear_auto_sign_in_; 177 SubTask clear_auto_sign_in_;
178 // Counts the number of plugin data tasks. Should be the number of LSO cookies
179 // to be deleted, or 1 while we're fetching LSO cookies or deleting in bulk.
180 int clear_plugin_data_count_ = 0;
160 181
161 #if BUILDFLAG(ENABLE_PLUGINS) 182 #if BUILDFLAG(ENABLE_PLUGINS)
183 // Used to delete plugin data.
184 std::unique_ptr<content::PluginDataRemover> plugin_data_remover_;
185 base::WaitableEventWatcher watcher_;
186
187 // Used for per-site plugin data deletion.
188 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper_;
189
162 uint32_t deauthorize_flash_content_licenses_request_id_ = 0; 190 uint32_t deauthorize_flash_content_licenses_request_id_ = 0;
163 191
164 // Used to deauthorize content licenses for Pepper Flash. 192 // Used to deauthorize content licenses for Pepper Flash.
165 std::unique_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_; 193 std::unique_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_;
166 #endif 194 #endif
167 195
168 // Used if we need to clear history. 196 // Used if we need to clear history.
169 base::CancelableTaskTracker history_task_tracker_; 197 base::CancelableTaskTracker history_task_tracker_;
170 198
171 std::unique_ptr<TemplateURLService::Subscription> template_url_sub_; 199 std::unique_ptr<TemplateURLService::Subscription> template_url_sub_;
172 200
173 #if defined(OS_ANDROID) 201 #if defined(OS_ANDROID)
174 // WebappRegistry makes calls across the JNI. In unit tests, the Java side is 202 // WebappRegistry makes calls across the JNI. In unit tests, the Java side is
175 // not initialised, so the registry must be mocked out. 203 // not initialised, so the registry must be mocked out.
176 std::unique_ptr<WebappRegistry> webapp_registry_; 204 std::unique_ptr<WebappRegistry> webapp_registry_;
177 #endif 205 #endif
178 206
179 base::WeakPtrFactory<ChromeBrowsingDataRemoverDelegate> weak_ptr_factory_; 207 base::WeakPtrFactory<ChromeBrowsingDataRemoverDelegate> weak_ptr_factory_;
180 208
181 DISALLOW_COPY_AND_ASSIGN(ChromeBrowsingDataRemoverDelegate); 209 DISALLOW_COPY_AND_ASSIGN(ChromeBrowsingDataRemoverDelegate);
182 }; 210 };
183 211
184 #endif // CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_ 212 #endif // CHROME_BROWSER_BROWSING_DATA_CHROME_BROWSING_DATA_REMOVER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698