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

Side by Side Diff: chrome/browser/extensions/extension_permissions_api.h

Issue 7508029: Add origin permissions to the extension permissions API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix dcheck Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_permissions_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/extensions/extension_function.h" 9 #include "chrome/browser/extensions/extension_function.h"
10 #include "chrome/browser/extensions/extension_install_ui.h" 10 #include "chrome/browser/extensions/extension_install_ui.h"
(...skipping 30 matching lines...) Expand all
41 enum EventType { 41 enum EventType {
42 ADDED, 42 ADDED,
43 REMOVED, 43 REMOVED,
44 }; 44 };
45 45
46 // Dispatches specified event to the extension. 46 // Dispatches specified event to the extension.
47 void DispatchEvent(const std::string& extension_id, 47 void DispatchEvent(const std::string& extension_id,
48 const char* event_name, 48 const char* event_name,
49 const ExtensionPermissionSet* changed_permissions); 49 const ExtensionPermissionSet* changed_permissions);
50 50
51 // Issues the relevant events, messages and notifications when the permissions 51 // Issues the relevant events, messages and notifications when the
52 // have changed for the |extension| (|changed| is the permission delta, while 52 // |extension|'s permissions have |changed| (|changed| is the delta).
53 // |active| is the new permission set). Specifically, this sends the 53 // Specifically, this sends the EXTENSION_PERMISSIONS_UPDATED notification,
54 // EXTENSION_PERMISSIONS_UPDATED notification, the 54 // the ExtensionMsg_UpdatePermissions IPC message, and fires the
55 // ExtensionMsg_UpdatePermissions IPC message, and fires the onAdded/onRemoved 55 // onAdded/onRemoved events in the extension.
56 // events in the extension. 56 void NotifyPermissionsUpdated(EventType event_type,
57 void NotifyPermissionsUpdated(const Extension* extension, 57 const Extension* extension,
58 const ExtensionPermissionSet* active, 58 const ExtensionPermissionSet* changed);
59 const ExtensionPermissionSet* changed,
60 EventType event_type);
61 59
62 ExtensionService* extension_service_; 60 ExtensionService* extension_service_;
63 }; 61 };
64 62
65 63
66 // chrome.permissions.contains 64 // chrome.permissions.contains
67 class ContainsPermissionsFunction : public SyncExtensionFunction { 65 class ContainsPermissionsFunction : public SyncExtensionFunction {
68 virtual ~ContainsPermissionsFunction() {} 66 virtual ~ContainsPermissionsFunction() {}
69 virtual bool RunImpl() OVERRIDE; 67 virtual bool RunImpl() OVERRIDE;
70 DECLARE_EXTENSION_FUNCTION_NAME("experimental.permissions.contains") 68 DECLARE_EXTENSION_FUNCTION_NAME("experimental.permissions.contains")
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 virtual bool RunImpl() OVERRIDE; 100 virtual bool RunImpl() OVERRIDE;
103 101
104 private: 102 private:
105 scoped_ptr<ExtensionInstallUI> install_ui_; 103 scoped_ptr<ExtensionInstallUI> install_ui_;
106 scoped_refptr<ExtensionPermissionSet> requested_permissions_; 104 scoped_refptr<ExtensionPermissionSet> requested_permissions_;
107 const Extension* extension_; 105 const Extension* extension_;
108 DECLARE_EXTENSION_FUNCTION_NAME("experimental.permissions.request") 106 DECLARE_EXTENSION_FUNCTION_NAME("experimental.permissions.request")
109 }; 107 };
110 108
111 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__ 109 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PERMISSIONS_API_H__
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_permissions_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698