OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
10 #include "chrome/browser/extensions/extension_function.h" | 12 #include "chrome/browser/extensions/extension_function.h" |
11 #include "chrome/browser/extensions/extension_install_ui.h" | 13 #include "chrome/browser/extensions/extension_install_ui.h" |
12 #include "chrome/common/extensions/extension_permission_set.h" | 14 #include "chrome/common/extensions/extension_permission_set.h" |
13 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
14 #include "content/browser/renderer_host/render_process_host.h" | 16 #include "content/browser/renderer_host/render_process_host.h" |
15 | 17 |
16 namespace base { | |
17 class DictionaryValue; | |
18 } | |
19 class Extension; | 18 class Extension; |
20 class ExtensionPermissionSet; | 19 class ExtensionPermissionSet; |
21 class ExtensionService; | 20 class ExtensionService; |
22 class Profile; | |
23 | 21 |
24 class ExtensionPermissionsManager { | 22 class ExtensionPermissionsManager { |
25 public: | 23 public: |
26 explicit ExtensionPermissionsManager(ExtensionService* extension_service); | 24 explicit ExtensionPermissionsManager(ExtensionService* extension_service); |
27 ~ExtensionPermissionsManager(); | 25 ~ExtensionPermissionsManager(); |
28 | 26 |
29 // Adds the set of |permissions| to the |extension|'s active permission set | 27 // Adds the set of |permissions| to the |extension|'s active permission set |
30 // and sends the relevant messages and notifications. This method assumes the | 28 // and sends the relevant messages and notifications. This method assumes the |
31 // user has already been prompted, if necessary, for the extra permissions. | 29 // user has already been prompted, if necessary, for the extra permissions. |
32 void AddPermissions(const Extension* extension, | 30 void AddPermissions(const Extension* extension, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 virtual bool RunImpl() OVERRIDE; | 99 virtual bool RunImpl() OVERRIDE; |
102 | 100 |
103 private: | 101 private: |
104 scoped_ptr<ExtensionInstallUI> install_ui_; | 102 scoped_ptr<ExtensionInstallUI> install_ui_; |
105 scoped_refptr<ExtensionPermissionSet> requested_permissions_; | 103 scoped_refptr<ExtensionPermissionSet> requested_permissions_; |
106 const Extension* extension_; | 104 const Extension* extension_; |
107 DECLARE_EXTENSION_FUNCTION_NAME("permissions.request") | 105 DECLARE_EXTENSION_FUNCTION_NAME("permissions.request") |
108 }; | 106 }; |
109 | 107 |
110 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__ | 108 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__ |
OLD | NEW |