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

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

Issue 874683005: [Extensions] Enable the scripts-require-action feature based on all-urls pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated metrics Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/extensions/active_script_controller.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_ACTIVE_SCRIPT_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const content::FrameNavigateParams& params) override; 123 const content::FrameNavigateParams& params) override;
124 124
125 // ExtensionRegistryObserver: 125 // ExtensionRegistryObserver:
126 void OnExtensionUnloaded(content::BrowserContext* browser_context, 126 void OnExtensionUnloaded(content::BrowserContext* browser_context,
127 const Extension* extension, 127 const Extension* extension,
128 UnloadedExtensionInfo::Reason reason) override; 128 UnloadedExtensionInfo::Reason reason) override;
129 129
130 // The associated browser context. 130 // The associated browser context.
131 content::BrowserContext* browser_context_; 131 content::BrowserContext* browser_context_;
132 132
133 // Whether or not the ActiveScriptController is enabled (corresponding to the 133 // Whether or not the feature was used for any extensions. This may not be the
134 // kActiveScriptEnforcement switch). If it is not, it acts as an empty shell, 134 // case if the user never enabled the scripts-require-action flag.
135 // always allowing scripts to run and never displaying actions. 135 bool was_used_on_page_;
136 bool enabled_;
137 136
138 // The map of extension_id:pending_request of all pending requests. 137 // The map of extension_id:pending_request of all pending requests.
139 PendingRequestMap pending_requests_; 138 PendingRequestMap pending_requests_;
140 139
141 // The extensions which have been granted permission to run on the given page. 140 // The extensions which have been granted permission to run on the given page.
142 // TODO(rdevlin.cronin): Right now, this just keeps track of extensions that 141 // TODO(rdevlin.cronin): Right now, this just keeps track of extensions that
143 // have been permitted to run on the page via this interface. Instead, it 142 // have been permitted to run on the page via this interface. Instead, it
144 // should incorporate more fully with ActiveTab. 143 // should incorporate more fully with ActiveTab.
145 std::set<std::string> permitted_extensions_; 144 std::set<std::string> permitted_extensions_;
146 145
147 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 146 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
148 extension_registry_observer_; 147 extension_registry_observer_;
149 148
150 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); 149 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController);
151 }; 150 };
152 151
153 } // namespace extensions 152 } // namespace extensions
154 153
155 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ 154 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/active_script_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698