| OLD | NEW |
| 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/browser/plugins/chrome_content_browser_client_plugins_part.h" | 5 #include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/plugins/plugin_info_message_filter.h" | 8 #include "chrome/browser/plugins/plugin_info_message_filter.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory
.h" | 10 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory
.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 #else | 110 #else |
| 111 return false; | 111 return false; |
| 112 #endif | 112 #endif |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool ChromeContentBrowserClientPluginsPart::IsPluginAllowedToUseDevChannelAPIs( | 115 bool ChromeContentBrowserClientPluginsPart::IsPluginAllowedToUseDevChannelAPIs( |
| 116 content::BrowserContext* browser_context, | 116 content::BrowserContext* browser_context, |
| 117 const GURL& url, | 117 const GURL& url, |
| 118 const std::set<std::string>& allowed_dev_channel_origins) { | 118 const std::set<std::string>& allowed_dev_channel_origins) { |
| 119 // Allow access for tests. | 119 // Allow access for tests. |
| 120 if (CommandLine::ForCurrentProcess()->HasSwitch( | 120 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 121 switches::kEnablePepperTesting)) { | 121 switches::kEnablePepperTesting)) { |
| 122 return true; | 122 return true; |
| 123 } | 123 } |
| 124 | 124 |
| 125 #if defined(ENABLE_EXTENSIONS) | 125 #if defined(ENABLE_EXTENSIONS) |
| 126 Profile* profile = Profile::FromBrowserContext(browser_context); | 126 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 127 const extensions::ExtensionSet* extension_set = NULL; | 127 const extensions::ExtensionSet* extension_set = NULL; |
| 128 if (profile) { | 128 if (profile) { |
| 129 extension_set = | 129 extension_set = |
| 130 &extensions::ExtensionRegistry::Get(profile)->enabled_extensions(); | 130 &extensions::ExtensionRegistry::Get(profile)->enabled_extensions(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 144 } | 144 } |
| 145 | 145 |
| 146 void ChromeContentBrowserClientPluginsPart::DidCreatePpapiPlugin( | 146 void ChromeContentBrowserClientPluginsPart::DidCreatePpapiPlugin( |
| 147 content::BrowserPpapiHost* browser_host) { | 147 content::BrowserPpapiHost* browser_host) { |
| 148 browser_host->GetPpapiHost()->AddHostFactoryFilter( | 148 browser_host->GetPpapiHost()->AddHostFactoryFilter( |
| 149 scoped_ptr<ppapi::host::HostFactory>( | 149 scoped_ptr<ppapi::host::HostFactory>( |
| 150 new chrome::ChromeBrowserPepperHostFactory(browser_host))); | 150 new chrome::ChromeBrowserPepperHostFactory(browser_host))); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace plugins | 153 } // namespace plugins |
| OLD | NEW |