| 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 "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" | 5 #include "content/ppapi_plugin/ppapi_webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "content/child/child_thread.h" | 13 #include "content/child/child_thread.h" |
| 14 #include "content/common/child_process_messages.h" | 14 #include "content/common/child_process_messages.h" |
| 15 #include "ppapi/proxy/plugin_globals.h" | 15 #include "ppapi/proxy/plugin_globals.h" |
| 16 #include "ppapi/shared_impl/proxy_lock.h" | 16 #include "ppapi/shared_impl/proxy_lock.h" |
| 17 #include "third_party/WebKit/public/platform/WebString.h" | 17 #include "third_party/WebKit/public/platform/WebString.h" |
| 18 | 18 |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 20 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" | 20 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" |
| 21 #elif defined(OS_MACOSX) | 21 #elif defined(OS_MACOSX) |
| 22 #include "base/mac/mac_util.h" | |
| 23 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" | 22 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" |
| 24 #elif defined(OS_ANDROID) | 23 #elif defined(OS_ANDROID) |
| 25 #include "third_party/WebKit/public/platform/android/WebSandboxSupport.h" | 24 #include "third_party/WebKit/public/platform/android/WebSandboxSupport.h" |
| 26 #elif defined(OS_POSIX) | 25 #elif defined(OS_POSIX) |
| 27 #include "content/common/child_process_sandbox_support_impl_linux.h" | 26 #include "content/common/child_process_sandbox_support_impl_linux.h" |
| 28 #include "third_party/WebKit/public/platform/linux/WebFallbackFont.h" | 27 #include "third_party/WebKit/public/platform/linux/WebFallbackFont.h" |
| 29 #include "third_party/WebKit/public/platform/linux/WebSandboxSupport.h" | 28 #include "third_party/WebKit/public/platform/linux/WebSandboxSupport.h" |
| 30 #include "third_party/icu/source/common/unicode/utf16.h" | 29 #include "third_party/icu/source/common/unicode/utf16.h" |
| 31 #endif | 30 #endif |
| 32 | 31 |
| 33 using blink::WebSandboxSupport; | 32 using blink::WebSandboxSupport; |
| 34 using blink::WebString; | 33 using blink::WebString; |
| 35 using blink::WebUChar; | 34 using blink::WebUChar; |
| 36 using blink::WebUChar32; | 35 using blink::WebUChar32; |
| 37 | 36 |
| 38 typedef struct CGFont* CGFontRef; | 37 typedef struct CGFont* CGFontRef; |
| 39 | 38 |
| 40 namespace content { | 39 namespace content { |
| 41 | 40 |
| 42 class PpapiWebKitPlatformSupportImpl::SandboxSupport | 41 class PpapiWebKitPlatformSupportImpl::SandboxSupport |
| 43 : public WebSandboxSupport { | 42 : public WebSandboxSupport { |
| 44 public: | 43 public: |
| 45 virtual ~SandboxSupport() {} | 44 virtual ~SandboxSupport() {} |
| 46 | 45 |
| 47 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 48 virtual bool ensureFontLoaded(HFONT); | 47 virtual bool ensureFontLoaded(HFONT); |
| 49 #elif defined(OS_MACOSX) | 48 #elif defined(OS_MACOSX) |
| 50 virtual bool loadFont( | 49 virtual bool loadFont( |
| 51 NSFont* srcFont, CGFontRef* out, uint32_t* fontID); | 50 NSFont* srcFont, CGFontRef* out, uint32_t* fontID); |
| 52 virtual CGColorSpaceRef displayColorSpace(); | |
| 53 #elif defined(OS_ANDROID) | 51 #elif defined(OS_ANDROID) |
| 54 // Empty class. | 52 // Empty class. |
| 55 #elif defined(OS_POSIX) | 53 #elif defined(OS_POSIX) |
| 56 SandboxSupport(); | 54 SandboxSupport(); |
| 57 virtual void getFallbackFontForCharacter( | 55 virtual void getFallbackFontForCharacter( |
| 58 WebUChar32 character, | 56 WebUChar32 character, |
| 59 const char* preferred_locale, | 57 const char* preferred_locale, |
| 60 blink::WebFallbackFont* fallbackFont); | 58 blink::WebFallbackFont* fallbackFont); |
| 61 virtual void getRenderStyleForStrike( | 59 virtual void getRenderStyleForStrike( |
| 62 const char* family, int sizeAndStyle, blink::WebFontRenderStyle* out); | 60 const char* family, int sizeAndStyle, blink::WebFontRenderStyle* out); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 90 NSFont* src_font, | 88 NSFont* src_font, |
| 91 CGFontRef* out, | 89 CGFontRef* out, |
| 92 uint32_t* font_id) { | 90 uint32_t* font_id) { |
| 93 // TODO(brettw) this should do the something similar to what | 91 // TODO(brettw) this should do the something similar to what |
| 94 // RendererWebKitClientImpl does and request that the browser load the font. | 92 // RendererWebKitClientImpl does and request that the browser load the font. |
| 95 // Note: need to unlock the proxy lock like ensureFontLoaded does. | 93 // Note: need to unlock the proxy lock like ensureFontLoaded does. |
| 96 NOTIMPLEMENTED(); | 94 NOTIMPLEMENTED(); |
| 97 return false; | 95 return false; |
| 98 } | 96 } |
| 99 | 97 |
| 100 CGColorSpaceRef | |
| 101 PpapiWebKitPlatformSupportImpl::SandboxSupport::displayColorSpace() { | |
| 102 return base::mac::GetSystemColorSpace(); | |
| 103 } | |
| 104 | |
| 105 #elif defined(OS_ANDROID) | 98 #elif defined(OS_ANDROID) |
| 106 | 99 |
| 107 // Empty class. | 100 // Empty class. |
| 108 | 101 |
| 109 #elif defined(OS_POSIX) | 102 #elif defined(OS_POSIX) |
| 110 | 103 |
| 111 PpapiWebKitPlatformSupportImpl::SandboxSupport::SandboxSupport() | 104 PpapiWebKitPlatformSupportImpl::SandboxSupport::SandboxSupport() |
| 112 : creation_thread_(base::PlatformThread::CurrentId()) { | 105 : creation_thread_(base::PlatformThread::CurrentId()) { |
| 113 } | 106 } |
| 114 | 107 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 NOTREACHED(); | 252 NOTREACHED(); |
| 260 } | 253 } |
| 261 | 254 |
| 262 int PpapiWebKitPlatformSupportImpl::databaseDeleteFile( | 255 int PpapiWebKitPlatformSupportImpl::databaseDeleteFile( |
| 263 const blink::WebString& vfs_file_name, bool sync_dir) { | 256 const blink::WebString& vfs_file_name, bool sync_dir) { |
| 264 NOTREACHED(); | 257 NOTREACHED(); |
| 265 return 0; | 258 return 0; |
| 266 } | 259 } |
| 267 | 260 |
| 268 } // namespace content | 261 } // namespace content |
| OLD | NEW |