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

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

Issue 10702017: Revert r 144574 "Modify experimental identity flow to display scope descriptions and details." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
OLDNEW
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_EXTENSIONS_PERMISSIONS_UPDATER_H__ 5 #ifndef CHROME_BROWSER_EXTENSIONS_PERMISSIONS_UPDATER_H__
6 #define CHROME_BROWSER_EXTENSIONS_PERMISSIONS_UPDATER_H__ 6 #define CHROME_BROWSER_EXTENSIONS_PERMISSIONS_UPDATER_H__
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 void AddPermissions(const Extension* extension, 35 void AddPermissions(const Extension* extension,
36 const PermissionSet* permissions); 36 const PermissionSet* permissions);
37 37
38 // Removes the set of |permissions| from the |extension|'s active permission 38 // Removes the set of |permissions| from the |extension|'s active permission
39 // set and sends the relevant messages and notifications. 39 // set and sends the relevant messages and notifications.
40 void RemovePermissions(const Extension* extension, 40 void RemovePermissions(const Extension* extension,
41 const PermissionSet* permissions); 41 const PermissionSet* permissions);
42 42
43 // Adds all permissions in the |extension|'s active permissions to its 43 // Adds all permissions in the |extension|'s active permissions to its
44 // granted permission set. 44 // granted permission set.
45 void GrantActivePermissions(const Extension* extension, 45 void GrantActivePermissions(const Extension* extension);
46 bool record_oauth2_grant);
47 46
48 // Sets the |extension|'s active permissions to |permissions|. 47 // Sets the |extension|'s active permissions to |permissions|.
49 void UpdateActivePermissions(const Extension* extension, 48 void UpdateActivePermissions(const Extension* extension,
50 const PermissionSet* permissions); 49 const PermissionSet* permissions);
51 50
52 private: 51 private:
53 enum EventType { 52 enum EventType {
54 ADDED, 53 ADDED,
55 REMOVED, 54 REMOVED,
56 }; 55 };
57 56
58 // Records the oauth2 grant for the scopes specified in |permissions|.
59 void RecordOAuth2Grant(const Extension* extension);
60
61 // Dispatches specified event to the extension. 57 // Dispatches specified event to the extension.
62 void DispatchEvent(const std::string& extension_id, 58 void DispatchEvent(const std::string& extension_id,
63 const char* event_name, 59 const char* event_name,
64 const PermissionSet* changed_permissions); 60 const PermissionSet* changed_permissions);
65 61
66 // Issues the relevant events, messages and notifications when the 62 // Issues the relevant events, messages and notifications when the
67 // |extension|'s permissions have |changed| (|changed| is the delta). 63 // |extension|'s permissions have |changed| (|changed| is the delta).
68 // Specifically, this sends the EXTENSION_PERMISSIONS_UPDATED notification, 64 // Specifically, this sends the EXTENSION_PERMISSIONS_UPDATED notification,
69 // the ExtensionMsg_UpdatePermissions IPC message, and fires the 65 // the ExtensionMsg_UpdatePermissions IPC message, and fires the
70 // onAdded/onRemoved events in the extension. 66 // onAdded/onRemoved events in the extension.
71 void NotifyPermissionsUpdated(EventType event_type, 67 void NotifyPermissionsUpdated(EventType event_type,
72 const Extension* extension, 68 const Extension* extension,
73 const PermissionSet* changed); 69 const PermissionSet* changed);
74 70
75 // Gets the ExtensionPrefs for the associated profile. 71 // Gets the ExtensionPrefs for the associated profile.
76 ExtensionPrefs* GetExtensionPrefs(); 72 ExtensionPrefs* GetExtensionPrefs();
77 73
78 Profile* profile_; 74 Profile* profile_;
79 }; 75 };
80 76
81 } // namespace extensions 77 } // namespace extensions
82 78
83 #endif // CHROME_BROWSER_EXTENSIONS_PERMISSIONS_UPDATER_H__ 79 #endif // CHROME_BROWSER_EXTENSIONS_PERMISSIONS_UPDATER_H__
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698