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 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" | 5 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "chrome/browser/pepper_flash_settings_manager.h" | 12 #include "chrome/browser/pepper_flash_settings_manager.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 class BrowsingDataFlashLSOHelperImpl | 16 class BrowsingDataFlashLSOHelperImpl |
17 : public BrowsingDataFlashLSOHelper, | 17 : public BrowsingDataFlashLSOHelper, |
18 public PepperFlashSettingsManager::Client { | 18 public PepperFlashSettingsManager::Client { |
19 public: | 19 public: |
20 explicit BrowsingDataFlashLSOHelperImpl( | 20 explicit BrowsingDataFlashLSOHelperImpl( |
21 content::BrowserContext* browser_context); | 21 content::BrowserContext* browser_context); |
22 | 22 |
23 // BrowsingDataFlashLSOHelper implementation: | 23 // BrowsingDataFlashLSOHelper implementation: |
24 virtual void StartFetching( | 24 void StartFetching(const GetSitesWithFlashDataCallback& callback) override; |
25 const GetSitesWithFlashDataCallback& callback) override; | 25 void DeleteFlashLSOsForSite(const std::string& site) override; |
26 virtual void DeleteFlashLSOsForSite(const std::string& site) override; | |
27 | 26 |
28 // PepperFlashSettingsManager::Client overrides: | 27 // PepperFlashSettingsManager::Client overrides: |
29 virtual void OnGetSitesWithDataCompleted( | 28 void OnGetSitesWithDataCompleted( |
30 uint32 request_id, | 29 uint32 request_id, |
31 const std::vector<std::string>& sites) override; | 30 const std::vector<std::string>& sites) override; |
32 virtual void OnClearSiteDataCompleted( | 31 void OnClearSiteDataCompleted(uint32 request_id, bool success) override; |
33 uint32 request_id, | |
34 bool success) override; | |
35 | 32 |
36 private: | 33 private: |
37 virtual ~BrowsingDataFlashLSOHelperImpl(); | 34 ~BrowsingDataFlashLSOHelperImpl() override; |
38 | 35 |
39 // Asynchronously fetches and deletes data and calls us back. | 36 // Asynchronously fetches and deletes data and calls us back. |
40 PepperFlashSettingsManager settings_manager_; | 37 PepperFlashSettingsManager settings_manager_; |
41 | 38 |
42 // Identifies the request to fetch site data. | 39 // Identifies the request to fetch site data. |
43 uint32 get_sites_with_data_request_id_; | 40 uint32 get_sites_with_data_request_id_; |
44 | 41 |
45 // Contains the pending requests to clear site data. The key is the request | 42 // Contains the pending requests to clear site data. The key is the request |
46 // ID, the value the site for which to clear data. | 43 // ID, the value the site for which to clear data. |
47 std::map<uint32, std::string> clear_site_data_ids_; | 44 std::map<uint32, std::string> clear_site_data_ids_; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 clear_site_data_ids_.erase(entry); | 91 clear_site_data_ids_.erase(entry); |
95 } | 92 } |
96 | 93 |
97 } // namespace | 94 } // namespace |
98 | 95 |
99 // static | 96 // static |
100 BrowsingDataFlashLSOHelper* BrowsingDataFlashLSOHelper::Create( | 97 BrowsingDataFlashLSOHelper* BrowsingDataFlashLSOHelper::Create( |
101 content::BrowserContext* browser_context) { | 98 content::BrowserContext* browser_context) { |
102 return new BrowsingDataFlashLSOHelperImpl(browser_context); | 99 return new BrowsingDataFlashLSOHelperImpl(browser_context); |
103 } | 100 } |
OLD | NEW |