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

Side by Side Diff: extensions/shell/browser/shell_extensions_browser_client.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #include "extensions/shell/browser/shell_extensions_browser_client.h" 5 #include "extensions/shell/browser/shell_extensions_browser_client.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/prefs/pref_service_factory.h" 8 #include "base/prefs/pref_service_factory.h"
9 #include "base/prefs/testing_pref_store.h" 9 #include "base/prefs/testing_pref_store.h"
10 #include "components/pref_registry/pref_registry_syncable.h" 10 #include "components/pref_registry/pref_registry_syncable.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 bool ShellExtensionsBrowserClient::HasOffTheRecordContext( 78 bool ShellExtensionsBrowserClient::HasOffTheRecordContext(
79 BrowserContext* context) { 79 BrowserContext* context) {
80 return false; 80 return false;
81 } 81 }
82 82
83 BrowserContext* ShellExtensionsBrowserClient::GetOffTheRecordContext( 83 BrowserContext* ShellExtensionsBrowserClient::GetOffTheRecordContext(
84 BrowserContext* context) { 84 BrowserContext* context) {
85 // app_shell only supports a single context. 85 // app_shell only supports a single context.
86 return NULL; 86 return nullptr;
87 } 87 }
88 88
89 BrowserContext* ShellExtensionsBrowserClient::GetOriginalContext( 89 BrowserContext* ShellExtensionsBrowserClient::GetOriginalContext(
90 BrowserContext* context) { 90 BrowserContext* context) {
91 return context; 91 return context;
92 } 92 }
93 93
94 bool ShellExtensionsBrowserClient::IsGuestSession( 94 bool ShellExtensionsBrowserClient::IsGuestSession(
95 BrowserContext* context) const { 95 BrowserContext* context) const {
96 return false; 96 return false;
(...skipping 11 matching lines...) Expand all
108 return false; 108 return false;
109 } 109 }
110 110
111 net::URLRequestJob* 111 net::URLRequestJob*
112 ShellExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob( 112 ShellExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob(
113 net::URLRequest* request, 113 net::URLRequest* request,
114 net::NetworkDelegate* network_delegate, 114 net::NetworkDelegate* network_delegate,
115 const base::FilePath& directory_path, 115 const base::FilePath& directory_path,
116 const std::string& content_security_policy, 116 const std::string& content_security_policy,
117 bool send_cors_header) { 117 bool send_cors_header) {
118 return NULL; 118 return nullptr;
119 } 119 }
120 120
121 bool ShellExtensionsBrowserClient::AllowCrossRendererResourceLoad( 121 bool ShellExtensionsBrowserClient::AllowCrossRendererResourceLoad(
122 net::URLRequest* request, 122 net::URLRequest* request,
123 bool is_incognito, 123 bool is_incognito,
124 const Extension* extension, 124 const Extension* extension,
125 InfoMap* extension_info_map) { 125 InfoMap* extension_info_map) {
126 bool allowed = false; 126 bool allowed = false;
127 if (url_request_util::AllowCrossRendererResourceLoad( 127 if (url_request_util::AllowCrossRendererResourceLoad(
128 request, is_incognito, extension, extension_info_map, &allowed)) { 128 request, is_incognito, extension, extension_info_map, &allowed)) {
129 return allowed; 129 return allowed;
130 } 130 }
131 131
132 // Couldn't determine if resource is allowed. Block the load. 132 // Couldn't determine if resource is allowed. Block the load.
133 return false; 133 return false;
134 } 134 }
135 135
136 PrefService* ShellExtensionsBrowserClient::GetPrefServiceForContext( 136 PrefService* ShellExtensionsBrowserClient::GetPrefServiceForContext(
137 BrowserContext* context) { 137 BrowserContext* context) {
138 return prefs_.get(); 138 return prefs_.get();
139 } 139 }
140 140
141 void ShellExtensionsBrowserClient::GetEarlyExtensionPrefsObservers( 141 void ShellExtensionsBrowserClient::GetEarlyExtensionPrefsObservers(
142 content::BrowserContext* context, 142 content::BrowserContext* context,
143 std::vector<ExtensionPrefsObserver*>* observers) const { 143 std::vector<ExtensionPrefsObserver*>* observers) const {
144 } 144 }
145 145
146 ProcessManagerDelegate* 146 ProcessManagerDelegate*
147 ShellExtensionsBrowserClient::GetProcessManagerDelegate() const { 147 ShellExtensionsBrowserClient::GetProcessManagerDelegate() const {
148 return NULL; 148 return nullptr;
149 } 149 }
150 150
151 scoped_ptr<ExtensionHostDelegate> 151 scoped_ptr<ExtensionHostDelegate>
152 ShellExtensionsBrowserClient::CreateExtensionHostDelegate() { 152 ShellExtensionsBrowserClient::CreateExtensionHostDelegate() {
153 return scoped_ptr<ExtensionHostDelegate>(new ShellExtensionHostDelegate); 153 return scoped_ptr<ExtensionHostDelegate>(new ShellExtensionHostDelegate);
154 } 154 }
155 155
156 bool ShellExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) { 156 bool ShellExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) {
157 // TODO(jamescook): We might want to tell extensions when app_shell updates. 157 // TODO(jamescook): We might want to tell extensions when app_shell updates.
158 return false; 158 return false;
159 } 159 }
160 160
161 void ShellExtensionsBrowserClient::PermitExternalProtocolHandler() { 161 void ShellExtensionsBrowserClient::PermitExternalProtocolHandler() {
162 } 162 }
163 163
164 scoped_ptr<AppSorting> ShellExtensionsBrowserClient::CreateAppSorting() { 164 scoped_ptr<AppSorting> ShellExtensionsBrowserClient::CreateAppSorting() {
165 return scoped_ptr<AppSorting>(new NullAppSorting); 165 return scoped_ptr<AppSorting>(new NullAppSorting);
166 } 166 }
167 167
168 bool ShellExtensionsBrowserClient::IsRunningInForcedAppMode() { 168 bool ShellExtensionsBrowserClient::IsRunningInForcedAppMode() {
169 return false; 169 return false;
170 } 170 }
171 171
172 ApiActivityMonitor* ShellExtensionsBrowserClient::GetApiActivityMonitor( 172 ApiActivityMonitor* ShellExtensionsBrowserClient::GetApiActivityMonitor(
173 BrowserContext* context) { 173 BrowserContext* context) {
174 // app_shell doesn't monitor API function calls or events. 174 // app_shell doesn't monitor API function calls or events.
175 return NULL; 175 return nullptr;
176 } 176 }
177 177
178 ExtensionSystemProvider* 178 ExtensionSystemProvider*
179 ShellExtensionsBrowserClient::GetExtensionSystemFactory() { 179 ShellExtensionsBrowserClient::GetExtensionSystemFactory() {
180 return ShellExtensionSystemFactory::GetInstance(); 180 return ShellExtensionSystemFactory::GetInstance();
181 } 181 }
182 182
183 void ShellExtensionsBrowserClient::RegisterExtensionFunctions( 183 void ShellExtensionsBrowserClient::RegisterExtensionFunctions(
184 ExtensionFunctionRegistry* registry) const { 184 ExtensionFunctionRegistry* registry) const {
185 // Register core extension-system APIs. 185 // Register core extension-system APIs.
186 core_api::GeneratedFunctionRegistry::RegisterAll(registry); 186 core_api::GeneratedFunctionRegistry::RegisterAll(registry);
187 } 187 }
188 188
189 scoped_ptr<RuntimeAPIDelegate> 189 scoped_ptr<RuntimeAPIDelegate>
190 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( 190 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate(
191 content::BrowserContext* context) const { 191 content::BrowserContext* context) const {
192 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); 192 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate());
193 } 193 }
194 194
195 ComponentExtensionResourceManager* 195 ComponentExtensionResourceManager*
196 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { 196 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() {
197 return NULL; 197 return nullptr;
198 } 198 }
199 199
200 void ShellExtensionsBrowserClient::BroadcastEventToRenderers( 200 void ShellExtensionsBrowserClient::BroadcastEventToRenderers(
201 const std::string& event_name, 201 const std::string& event_name,
202 scoped_ptr<base::ListValue> args) { 202 scoped_ptr<base::ListValue> args) {
203 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 203 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
204 BrowserThread::PostTask( 204 BrowserThread::PostTask(
205 BrowserThread::UI, 205 BrowserThread::UI,
206 FROM_HERE, 206 FROM_HERE,
207 base::Bind(&ShellExtensionsBrowserClient::BroadcastEventToRenderers, 207 base::Bind(&ShellExtensionsBrowserClient::BroadcastEventToRenderers,
208 base::Unretained(this), 208 base::Unretained(this),
209 event_name, 209 event_name,
210 base::Passed(&args))); 210 base::Passed(&args)));
211 return; 211 return;
212 } 212 }
213 213
214 scoped_ptr<Event> event(new Event(event_name, args.Pass())); 214 scoped_ptr<Event> event(new Event(event_name, args.Pass()));
215 EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); 215 EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
216 } 216 }
217 217
218 net::NetLog* ShellExtensionsBrowserClient::GetNetLog() { 218 net::NetLog* ShellExtensionsBrowserClient::GetNetLog() {
219 return NULL; 219 return nullptr;
220 } 220 }
221 221
222 } // namespace extensions 222 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698