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

Side by Side Diff: chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc

Issue 327363002: Remove adview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More files deleted! Created 6 years, 6 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 "chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h" 5 #include "chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 source_map->RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS); 242 source_map->RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS);
243 source_map->RegisterSource("webview", IDR_WEBVIEW_CUSTOM_BINDINGS_JS); 243 source_map->RegisterSource("webview", IDR_WEBVIEW_CUSTOM_BINDINGS_JS);
244 // Note: webView not webview so that this doesn't interfere with the 244 // Note: webView not webview so that this doesn't interfere with the
245 // chrome.webview API bindings. 245 // chrome.webview API bindings.
246 source_map->RegisterSource("webView", IDR_WEB_VIEW_JS); 246 source_map->RegisterSource("webView", IDR_WEB_VIEW_JS);
247 source_map->RegisterSource("webViewExperimental", 247 source_map->RegisterSource("webViewExperimental",
248 IDR_WEB_VIEW_EXPERIMENTAL_JS); 248 IDR_WEB_VIEW_EXPERIMENTAL_JS);
249 source_map->RegisterSource("webViewRequest", 249 source_map->RegisterSource("webViewRequest",
250 IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS); 250 IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS);
251 source_map->RegisterSource("denyWebView", IDR_WEB_VIEW_DENY_JS); 251 source_map->RegisterSource("denyWebView", IDR_WEB_VIEW_DENY_JS);
252 source_map->RegisterSource("adView", IDR_AD_VIEW_JS);
253 source_map->RegisterSource("denyAdView", IDR_AD_VIEW_DENY_JS);
254 source_map->RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS); 252 source_map->RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS);
255 } 253 }
256 254
257 void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules( 255 void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
258 extensions::ModuleSystem* module_system, 256 extensions::ModuleSystem* module_system,
259 const extensions::Extension* extension, 257 const extensions::Extension* extension,
260 extensions::Feature::Context context_type, 258 extensions::Feature::Context context_type,
261 bool is_within_platform_app) { 259 bool is_within_platform_app) {
262 if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT && 260 if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT &&
263 is_within_platform_app && 261 is_within_platform_app &&
(...skipping 27 matching lines...) Expand all
291 hexencoded_id_hash == "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" || 289 hexencoded_id_hash == "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" ||
292 hexencoded_id_hash == "1A26E32DE447A17CBE5E9750CDBA78F58539B39C" || 290 hexencoded_id_hash == "1A26E32DE447A17CBE5E9750CDBA78F58539B39C" ||
293 hexencoded_id_hash == "59048028102D7B4C681DBC7BC6CD980C3DC66DA3") { 291 hexencoded_id_hash == "59048028102D7B4C681DBC7BC6CD980C3DC66DA3") {
294 module_system->Require("webViewExperimental"); 292 module_system->Require("webViewExperimental");
295 } 293 }
296 } 294 }
297 } else { 295 } else {
298 module_system->Require("denyWebView"); 296 module_system->Require("denyWebView");
299 } 297 }
300 } 298 }
301
302 // Same comment as above for <adview> tag.
303 if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT &&
304 is_within_platform_app) {
305 if (CommandLine::ForCurrentProcess()->HasSwitch(
306 ::switches::kEnableAdview)) {
307 if (extension->permissions_data()->HasAPIPermission(
308 extensions::APIPermission::kAdView)) {
309 module_system->Require("adView");
310 } else {
311 module_system->Require("denyAdView");
312 }
313 }
314 }
315 } 299 }
316 300
317 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( 301 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated(
318 const std::set<std::string>& extension_ids) { 302 const std::set<std::string>& extension_ids) {
319 // In single-process mode, the browser process reports the active extensions. 303 // In single-process mode, the browser process reports the active extensions.
320 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) 304 if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess))
321 return; 305 return;
322 crash_keys::SetActiveExtensions(extension_ids); 306 crash_keys::SetActiveExtensions(extension_ids);
323 } 307 }
324 308
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 354 }
371 355
372 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage( 356 void ChromeExtensionsDispatcherDelegate::HandleWebRequestAPIUsage(
373 bool adblock, 357 bool adblock,
374 bool adblock_plus, 358 bool adblock_plus,
375 bool other) { 359 bool other) {
376 webrequest_adblock_ = adblock; 360 webrequest_adblock_ = adblock;
377 webrequest_adblock_plus_ = adblock_plus; 361 webrequest_adblock_plus_ = adblock_plus;
378 webrequest_other_ = other; 362 webrequest_other_ = other;
379 } 363 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/resources/extensions/ad_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698