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_PEPPER_FLASH_SETTINGS_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ |
6 #define CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ | 6 #define CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "ppapi/c/private/ppp_flash_browser_operations.h" | 10 #include "ppapi/c/private/ppp_flash_browser_operations.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 uint32 request_id, | 35 uint32 request_id, |
36 bool success, | 36 bool success, |
37 PP_Flash_BrowserOperations_Permission default_permission, | 37 PP_Flash_BrowserOperations_Permission default_permission, |
38 const ppapi::FlashSiteSettings& sites) {} | 38 const ppapi::FlashSiteSettings& sites) {} |
39 | 39 |
40 virtual void OnSetDefaultPermissionCompleted(uint32 request_id, | 40 virtual void OnSetDefaultPermissionCompleted(uint32 request_id, |
41 bool success) {} | 41 bool success) {} |
42 | 42 |
43 virtual void OnSetSitePermissionCompleted(uint32 request_id, | 43 virtual void OnSetSitePermissionCompleted(uint32 request_id, |
44 bool success) {} | 44 bool success) {} |
| 45 |
| 46 virtual void OnGetSitesWithDataCompleted( |
| 47 uint32 request_id, |
| 48 const std::vector<std::string>& sites) {} |
| 49 |
| 50 virtual void OnClearSiteDataCompleted(uint32 request_id, bool success) {} |
45 }; | 51 }; |
46 | 52 |
47 // |client| must outlive this object. It is guaranteed that |client| won't | 53 // |client| must outlive this object. It is guaranteed that |client| won't |
48 // receive any notifications after this object goes away. | 54 // receive any notifications after this object goes away. |
49 PepperFlashSettingsManager(Client* client, | 55 PepperFlashSettingsManager(Client* client, |
50 content::BrowserContext* browser_context); | 56 content::BrowserContext* browser_context); |
51 ~PepperFlashSettingsManager(); | 57 ~PepperFlashSettingsManager(); |
52 | 58 |
53 // |plugin_info| will be updated if it is not NULL and the method returns | 59 // |plugin_info| will be updated if it is not NULL and the method returns |
54 // true. | 60 // true. |
(...skipping 22 matching lines...) Expand all Loading... |
77 PP_Flash_BrowserOperations_SettingType setting_type, | 83 PP_Flash_BrowserOperations_SettingType setting_type, |
78 PP_Flash_BrowserOperations_Permission permission, | 84 PP_Flash_BrowserOperations_Permission permission, |
79 bool clear_site_specific); | 85 bool clear_site_specific); |
80 | 86 |
81 // Sets site-specific permission. | 87 // Sets site-specific permission. |
82 // Client::OnSetSitePermissionCompleted() will be called when the operation | 88 // Client::OnSetSitePermissionCompleted() will be called when the operation |
83 // is completed. | 89 // is completed. |
84 uint32 SetSitePermission(PP_Flash_BrowserOperations_SettingType setting_type, | 90 uint32 SetSitePermission(PP_Flash_BrowserOperations_SettingType setting_type, |
85 const ppapi::FlashSiteSettings& sites); | 91 const ppapi::FlashSiteSettings& sites); |
86 | 92 |
| 93 // Gets a list of sites that have stored data. |
| 94 // Client::OnGetSitesWithDataCompleted() will be called when the operation is |
| 95 // completed. |
| 96 uint32 GetSitesWithData(); |
| 97 |
| 98 // Clears data for a certain site. |
| 99 // Client::OnClearSiteDataompleted() will be called when the operation is |
| 100 // completed. |
| 101 uint32 ClearSiteData(const std::string& site, uint64 flags, uint64 max_age); |
| 102 |
87 private: | 103 private: |
88 // Core does most of the work. It is ref-counted so that its lifespan can be | 104 // Core does most of the work. It is ref-counted so that its lifespan can be |
89 // independent of the containing object's: | 105 // independent of the containing object's: |
90 // - The manager can be deleted on the UI thread while the core still being | 106 // - The manager can be deleted on the UI thread while the core still being |
91 // used on the I/O thread. | 107 // used on the I/O thread. |
92 // - The manager can delete the core when it encounters errors and create | 108 // - The manager can delete the core when it encounters errors and create |
93 // another one to handle new requests. | 109 // another one to handle new requests. |
94 class Core; | 110 class Core; |
95 | 111 |
96 uint32 GetNextRequestId(); | 112 uint32 GetNextRequestId(); |
(...skipping 10 matching lines...) Expand all Loading... |
107 content::BrowserContext* browser_context_; | 123 content::BrowserContext* browser_context_; |
108 | 124 |
109 scoped_refptr<Core> core_; | 125 scoped_refptr<Core> core_; |
110 | 126 |
111 uint32 next_request_id_; | 127 uint32 next_request_id_; |
112 | 128 |
113 DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsManager); | 129 DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsManager); |
114 }; | 130 }; |
115 | 131 |
116 #endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ | 132 #endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ |
OLD | NEW |