| 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 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2619 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, | 2615 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, |
| 2620 sandbox::TargetPolicy::HANDLES_DUP_ANY, | 2616 sandbox::TargetPolicy::HANDLES_DUP_ANY, |
| 2621 L"File"); | 2617 L"File"); |
| 2622 if (result != sandbox::SBOX_ALL_OK) { | 2618 if (result != sandbox::SBOX_ALL_OK) { |
| 2623 *success = false; | 2619 *success = false; |
| 2624 return; | 2620 return; |
| 2625 } | 2621 } |
| 2626 } | 2622 } |
| 2627 #endif | 2623 #endif |
| 2628 | 2624 |
| 2629 #if defined(USE_NSS) | |
| 2630 crypto::CryptoModuleBlockingPasswordDelegate* | |
| 2631 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | |
| 2632 const GURL& url) { | |
| 2633 return chrome::NewCryptoModuleBlockingDialogDelegate( | |
| 2634 chrome::kCryptoModulePasswordKeygen, url.host()); | |
| 2635 } | |
| 2636 #endif | |
| 2637 | |
| 2638 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( | 2625 bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( |
| 2639 content::BrowserContext* browser_context, | 2626 content::BrowserContext* browser_context, |
| 2640 const GURL& url) { | 2627 const GURL& url) { |
| 2641 #if defined(ENABLE_PLUGINS) | 2628 #if defined(ENABLE_PLUGINS) |
| 2642 Profile* profile = Profile::FromBrowserContext(browser_context); | 2629 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 2643 const ExtensionSet* extension_set = NULL; | 2630 const ExtensionSet* extension_set = NULL; |
| 2644 if (profile) { | 2631 if (profile) { |
| 2645 extension_set = extensions::ExtensionSystem::Get(profile)-> | 2632 extension_set = extensions::ExtensionSystem::Get(profile)-> |
| 2646 extension_service()->extensions(); | 2633 extension_service()->extensions(); |
| 2647 } | 2634 } |
| 2648 // TODO(teravest): Populate allowed_file_handle_origins_ when FileIO is moved | 2635 // TODO(teravest): Populate allowed_file_handle_origins_ when FileIO is moved |
| 2649 // from the renderer to the browser. | 2636 // from the renderer to the browser. |
| 2650 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2637 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
| 2651 allowed_file_handle_origins_) || | 2638 allowed_file_handle_origins_) || |
| 2652 IsHostAllowedByCommandLine(url, extension_set, | 2639 IsHostAllowedByCommandLine(url, extension_set, |
| 2653 switches::kAllowNaClFileHandleAPI); | 2640 switches::kAllowNaClFileHandleAPI); |
| 2654 #else | 2641 #else |
| 2655 return false; | 2642 return false; |
| 2656 #endif | 2643 #endif |
| 2657 } | 2644 } |
| 2658 | 2645 |
| 2659 } // namespace chrome | 2646 } // namespace chrome |
| OLD | NEW |