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

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

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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
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_EXTENSION_ACTION_RUNNER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_RUNNER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_RUNNER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_RUNNER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // Returns true if the given |extension| has any blocked actions. 78 // Returns true if the given |extension| has any blocked actions.
79 bool WantsToRun(const Extension* extension); 79 bool WantsToRun(const Extension* extension);
80 80
81 // Runs any blocked actions the extension has, but does not handle any page 81 // Runs any blocked actions the extension has, but does not handle any page
82 // refreshes for document_start/webRequest. 82 // refreshes for document_start/webRequest.
83 void RunForTesting(const Extension* extension); 83 void RunForTesting(const Extension* extension);
84 84
85 int num_page_requests() const { return num_page_requests_; } 85 int num_page_requests() const { return num_page_requests_; }
86 86
87 void set_default_bubble_close_action_for_testing( 87 void set_default_bubble_close_action_for_testing(
88 scoped_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> action) { 88 std::unique_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> action) {
89 default_bubble_close_action_for_testing_ = std::move(action); 89 default_bubble_close_action_for_testing_ = std::move(action);
90 } 90 }
91 91
92 #if defined(UNIT_TEST) 92 #if defined(UNIT_TEST)
93 // Only used in tests. 93 // Only used in tests.
94 PermissionsData::AccessType RequiresUserConsentForScriptInjectionForTesting( 94 PermissionsData::AccessType RequiresUserConsentForScriptInjectionForTesting(
95 const Extension* extension, 95 const Extension* extension,
96 UserScript::InjectionType type) { 96 UserScript::InjectionType type) {
97 return RequiresUserConsentForScriptInjection(extension, type); 97 return RequiresUserConsentForScriptInjection(extension, type);
98 } 98 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // TODO(rdevlin.cronin): Right now, this just keeps track of extensions that 195 // TODO(rdevlin.cronin): Right now, this just keeps track of extensions that
196 // have been permitted to run on the page via this interface. Instead, it 196 // have been permitted to run on the page via this interface. Instead, it
197 // should incorporate more fully with ActiveTab. 197 // should incorporate more fully with ActiveTab.
198 std::set<std::string> permitted_extensions_; 198 std::set<std::string> permitted_extensions_;
199 199
200 // If true, ignore active tab being granted rather than running pending 200 // If true, ignore active tab being granted rather than running pending
201 // actions. 201 // actions.
202 bool ignore_active_tab_granted_; 202 bool ignore_active_tab_granted_;
203 203
204 // If non-null, the bubble action to simulate for testing. 204 // If non-null, the bubble action to simulate for testing.
205 scoped_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> 205 std::unique_ptr<ToolbarActionsBarBubbleDelegate::CloseAction>
206 default_bubble_close_action_for_testing_; 206 default_bubble_close_action_for_testing_;
207 207
208 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 208 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
209 extension_registry_observer_; 209 extension_registry_observer_;
210 210
211 base::WeakPtrFactory<ExtensionActionRunner> weak_factory_; 211 base::WeakPtrFactory<ExtensionActionRunner> weak_factory_;
212 212
213 DISALLOW_COPY_AND_ASSIGN(ExtensionActionRunner); 213 DISALLOW_COPY_AND_ASSIGN(ExtensionActionRunner);
214 }; 214 };
215 215
216 } // namespace extensions 216 } // namespace extensions
217 217
218 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_RUNNER_H_ 218 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_RUNNER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_action_manager_unittest.cc ('k') | chrome/browser/extensions/extension_action_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698