OLD | NEW |
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 183 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
184 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 184 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
185 #endif | 185 #endif |
186 | 186 |
187 #if defined(OS_ANDROID) | 187 #if defined(OS_ANDROID) |
188 #include "ui/base/ui_base_paths.h" | 188 #include "ui/base/ui_base_paths.h" |
189 #include "ui/gfx/android/device_display_info.h" | 189 #include "ui/gfx/android/device_display_info.h" |
190 #endif | 190 #endif |
191 | 191 |
192 #if defined(USE_NSS) | |
193 #include "chrome/browser/ui/crypto_module_password_dialog.h" | |
194 #endif | |
195 | |
196 #if !defined(OS_CHROMEOS) | 192 #if !defined(OS_CHROMEOS) |
197 #include "chrome/browser/signin/signin_manager.h" | 193 #include "chrome/browser/signin/signin_manager.h" |
198 #include "chrome/browser/signin/signin_manager_factory.h" | 194 #include "chrome/browser/signin/signin_manager_factory.h" |
199 #endif | 195 #endif |
200 | 196 |
201 #if !defined(OS_ANDROID) | 197 #if !defined(OS_ANDROID) |
202 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 198 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
203 #endif | 199 #endif |
204 | 200 |
205 #if defined(ENABLE_WEBRTC) | 201 #if defined(ENABLE_WEBRTC) |
(...skipping 2412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2618 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, | 2614 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, |
2619 sandbox::TargetPolicy::HANDLES_DUP_ANY, | 2615 sandbox::TargetPolicy::HANDLES_DUP_ANY, |
2620 L"File"); | 2616 L"File"); |
2621 if (result != sandbox::SBOX_ALL_OK) { | 2617 if (result != sandbox::SBOX_ALL_OK) { |
2622 *success = false; | 2618 *success = false; |
2623 return; | 2619 return; |
2624 } | 2620 } |
2625 } | 2621 } |
2626 #endif | 2622 #endif |
2627 | 2623 |
2628 #if defined(USE_NSS) | |
2629 crypto::CryptoModuleBlockingPasswordDelegate* | |
2630 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | |
2631 const GURL& url) { | |
2632 return chrome::NewCryptoModuleBlockingDialogDelegate( | |
2633 chrome::kCryptoModulePasswordKeygen, url.host()); | |
2634 } | |
2635 #endif | |
2636 | |
2637 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( | 2624 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( |
2638 content::BrowserContext* browser_context, | 2625 content::BrowserContext* browser_context, |
2639 const GURL& url) { | 2626 const GURL& url) { |
2640 #if defined(ENABLE_PLUGINS) | 2627 #if defined(ENABLE_PLUGINS) |
2641 Profile* profile = Profile::FromBrowserContext(browser_context); | 2628 Profile* profile = Profile::FromBrowserContext(browser_context); |
2642 const ExtensionSet* extension_set = NULL; | 2629 const ExtensionSet* extension_set = NULL; |
2643 if (profile) { | 2630 if (profile) { |
2644 extension_set = extensions::ExtensionSystem::Get(profile)-> | 2631 extension_set = extensions::ExtensionSystem::Get(profile)-> |
2645 extension_service()->extensions(); | 2632 extension_service()->extensions(); |
2646 } | 2633 } |
2647 // TODO(teravest): Populate allowed_file_handle_origins_ when FileIO is moved | 2634 // TODO(teravest): Populate allowed_file_handle_origins_ when FileIO is moved |
2648 // from the renderer to the browser. | 2635 // from the renderer to the browser. |
2649 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2636 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
2650 allowed_file_handle_origins_) || | 2637 allowed_file_handle_origins_) || |
2651 IsHostAllowedByCommandLine(url, extension_set, | 2638 IsHostAllowedByCommandLine(url, extension_set, |
2652 switches::kAllowNaClFileHandleAPI); | 2639 switches::kAllowNaClFileHandleAPI); |
2653 #else | 2640 #else |
2654 return false; | 2641 return false; |
2655 #endif | 2642 #endif |
2656 } | 2643 } |
2657 | 2644 |
2658 } // namespace chrome | 2645 } // namespace chrome |
OLD | NEW |