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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 468913006: Added extension macro checks for android plugin files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 (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 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 } 2308 }
2309 #endif 2309 #endif
2310 return NULL; 2310 return NULL;
2311 } 2311 }
2312 2312
2313 bool ChromeContentBrowserClient::AllowPepperSocketAPI( 2313 bool ChromeContentBrowserClient::AllowPepperSocketAPI(
2314 content::BrowserContext* browser_context, 2314 content::BrowserContext* browser_context,
2315 const GURL& url, 2315 const GURL& url,
2316 bool private_api, 2316 bool private_api,
2317 const content::SocketPermissionRequest* params) { 2317 const content::SocketPermissionRequest* params) {
2318 #if defined(ENABLE_PLUGINS) 2318 #if defined(ENABLE_EXTENSIONS)
2319 Profile* profile = Profile::FromBrowserContext(browser_context); 2319 Profile* profile = Profile::FromBrowserContext(browser_context);
2320 const extensions::ExtensionSet* extension_set = NULL; 2320 const extensions::ExtensionSet* extension_set = NULL;
2321 if (profile) { 2321 if (profile) {
2322 const ExtensionService* ext_service = 2322 const ExtensionService* ext_service =
2323 extensions::ExtensionSystem::Get(profile)->extension_service(); 2323 extensions::ExtensionSystem::Get(profile)->extension_service();
2324 if (ext_service) { 2324 if (ext_service) {
2325 extension_set = ext_service->extensions(); 2325 extension_set = ext_service->extensions();
2326 } 2326 }
2327 } 2327 }
2328 2328
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 #endif 2524 #endif
2525 2525
2526 content::DevToolsManagerDelegate* 2526 content::DevToolsManagerDelegate*
2527 ChromeContentBrowserClient::GetDevToolsManagerDelegate() { 2527 ChromeContentBrowserClient::GetDevToolsManagerDelegate() {
2528 return new ChromeDevToolsManagerDelegate(); 2528 return new ChromeDevToolsManagerDelegate();
2529 } 2529 }
2530 2530
2531 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( 2531 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
2532 content::BrowserContext* browser_context, 2532 content::BrowserContext* browser_context,
2533 const GURL& url) { 2533 const GURL& url) {
2534 #if defined(ENABLE_PLUGINS) 2534 #if defined(ENABLE_EXTENSIONS)
2535 Profile* profile = Profile::FromBrowserContext(browser_context); 2535 Profile* profile = Profile::FromBrowserContext(browser_context);
2536 const extensions::ExtensionSet* extension_set = NULL; 2536 const extensions::ExtensionSet* extension_set = NULL;
2537 if (profile) { 2537 if (profile) {
2538 const ExtensionService* ext_service = 2538 const ExtensionService* ext_service =
2539 extensions::ExtensionSystem::Get(profile)->extension_service(); 2539 extensions::ExtensionSystem::Get(profile)->extension_service();
2540 if (ext_service) { 2540 if (ext_service) {
2541 extension_set = ext_service->extensions(); 2541 extension_set = ext_service->extensions();
2542 } 2542 }
2543 } 2543 }
2544 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, 2544 return IsExtensionOrSharedModuleWhitelisted(url, extension_set,
2545 allowed_file_handle_origins_) || 2545 allowed_file_handle_origins_) ||
2546 IsHostAllowedByCommandLine(url, extension_set, 2546 IsHostAllowedByCommandLine(url, extension_set,
2547 switches::kAllowNaClFileHandleAPI); 2547 switches::kAllowNaClFileHandleAPI);
2548 #else 2548 #else
2549 return false; 2549 return false;
2550 #endif 2550 #endif
2551 } 2551 }
2552 2552
2553 bool ChromeContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs( 2553 bool ChromeContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs(
2554 content::BrowserContext* browser_context, 2554 content::BrowserContext* browser_context,
2555 const GURL& url) { 2555 const GURL& url) {
2556 #if defined(ENABLE_PLUGINS) 2556 #if defined(ENABLE_EXTENSIONS)
2557 // Allow access for tests. 2557 // Allow access for tests.
2558 if (CommandLine::ForCurrentProcess()->HasSwitch( 2558 if (CommandLine::ForCurrentProcess()->HasSwitch(
2559 switches::kEnablePepperTesting)) { 2559 switches::kEnablePepperTesting)) {
2560 return true; 2560 return true;
2561 } 2561 }
2562 2562
2563 Profile* profile = Profile::FromBrowserContext(browser_context); 2563 Profile* profile = Profile::FromBrowserContext(browser_context);
2564 const extensions::ExtensionSet* extension_set = NULL; 2564 const extensions::ExtensionSet* extension_set = NULL;
2565 if (profile) { 2565 if (profile) {
2566 const ExtensionService* ext_service = 2566 const ExtensionService* ext_service =
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 switches::kDisableWebRtcEncryption, 2614 switches::kDisableWebRtcEncryption,
2615 }; 2615 };
2616 to_command_line->CopySwitchesFrom(from_command_line, 2616 to_command_line->CopySwitchesFrom(from_command_line,
2617 kWebRtcDevSwitchNames, 2617 kWebRtcDevSwitchNames,
2618 arraysize(kWebRtcDevSwitchNames)); 2618 arraysize(kWebRtcDevSwitchNames));
2619 } 2619 }
2620 } 2620 }
2621 #endif // defined(ENABLE_WEBRTC) 2621 #endif // defined(ENABLE_WEBRTC)
2622 2622
2623 } // namespace chrome 2623 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698