| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ | 5 #ifndef CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ |
| 6 #define CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ | 6 #define CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
| 9 #include "webkit/glue/simple_webmimeregistry_impl.h" | 9 #include "webkit/glue/simple_webmimeregistry_impl.h" |
| 10 #include "webkit/glue/webclipboard_impl.h" | 10 #include "webkit/glue/webclipboard_impl.h" |
| 11 #include "webkit/glue/webkitclient_impl.h" | 11 #include "webkit/glue/webkitclient_impl.h" |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 #include "webkit/api/public/win/WebSandboxSupport.h" | 14 #include "webkit/api/public/win/WebSandboxSupport.h" |
| 15 #elif defined(OS_LINUX) | 15 #elif defined(USE_X11) |
| 16 #include <string> | 16 #include <string> |
| 17 #include <map> | 17 #include <map> |
| 18 #include "base/lock.h" | 18 #include "base/lock.h" |
| 19 #include "webkit/api/public/linux/WebSandboxSupport.h" | 19 #include "webkit/api/public/linux/WebSandboxSupport.h" |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { | 22 class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { |
| 23 public: | 23 public: |
| 24 // WebKitClient methods: | 24 // WebKitClient methods: |
| 25 virtual WebKit::WebClipboard* clipboard(); | 25 virtual WebKit::WebClipboard* clipboard(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); | 60 virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); |
| 61 virtual WebKit::WebString preferredExtensionForMIMEType( | 61 virtual WebKit::WebString preferredExtensionForMIMEType( |
| 62 const WebKit::WebString&); | 62 const WebKit::WebString&); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 66 class SandboxSupport : public WebKit::WebSandboxSupport { | 66 class SandboxSupport : public WebKit::WebSandboxSupport { |
| 67 public: | 67 public: |
| 68 virtual bool ensureFontLoaded(HFONT); | 68 virtual bool ensureFontLoaded(HFONT); |
| 69 }; | 69 }; |
| 70 #elif defined(OS_LINUX) | 70 #elif defined(USE_X11) |
| 71 class SandboxSupport : public WebKit::WebSandboxSupport { | 71 class SandboxSupport : public WebKit::WebSandboxSupport { |
| 72 public: | 72 public: |
| 73 virtual WebKit::WebString getFontFamilyForCharacters( | 73 virtual WebKit::WebString getFontFamilyForCharacters( |
| 74 const WebKit::WebUChar* characters, size_t numCharacters); | 74 const WebKit::WebUChar* characters, size_t numCharacters); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 // WebKit likes to ask us for the correct font family to use for a set of | 77 // WebKit likes to ask us for the correct font family to use for a set of |
| 78 // unicode code points. It needs this information frequently so we cache it | 78 // unicode code points. It needs this information frequently so we cache it |
| 79 // here. The key in this map is an array of 16-bit UTF16 values from WebKit. | 79 // here. The key in this map is an array of 16-bit UTF16 values from WebKit. |
| 80 // The value is a string containing the correct font family. | 80 // The value is a string containing the correct font family. |
| 81 Lock unicode_font_families_mutex_; | 81 Lock unicode_font_families_mutex_; |
| 82 std::map<std::string, std::string> unicode_font_families_; | 82 std::map<std::string, std::string> unicode_font_families_; |
| 83 }; | 83 }; |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 webkit_glue::WebClipboardImpl clipboard_; | 86 webkit_glue::WebClipboardImpl clipboard_; |
| 87 | 87 |
| 88 MimeRegistry mime_registry_; | 88 MimeRegistry mime_registry_; |
| 89 #if defined(OS_WIN) || defined(OS_LINUX) | 89 #if defined(OS_WIN) || defined(OS_LINUX) |
| 90 SandboxSupport sandbox_support_; | 90 SandboxSupport sandbox_support_; |
| 91 #endif | 91 #endif |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 #endif // CHROME_RENDERER_WEBKIT_CLIENT_IMPL_H_ | 94 #endif // CHROME_RENDERER_WEBKIT_CLIENT_IMPL_H_ |
| OLD | NEW |