| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file provides the embedder's side of random webkit glue functions. | 5 // This file provides the embedder's side of random webkit glue functions. |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include <vector> | |
| 10 | |
| 11 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 12 #include <windows.h> | 10 #include <windows.h> |
| 13 #endif | 11 #endif |
| 14 | 12 |
| 13 #include <vector> |
| 14 |
| 15 #include "app/clipboard/clipboard.h" | 15 #include "app/clipboard/clipboard.h" |
| 16 #include "app/clipboard/scoped_clipboard_writer.h" | 16 #include "app/clipboard/scoped_clipboard_writer.h" |
| 17 #include "app/resource_bundle.h" | 17 #include "app/resource_bundle.h" |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/file_version_info.h" | 19 #include "base/file_version_info.h" |
| 20 #include "base/ref_counted.h" | 20 #include "base/ref_counted.h" |
| 21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
| 22 #include "chrome/app/chrome_version_info.h" | |
| 23 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 23 #include "chrome/common/chrome_version_info.h" |
| 24 #include "chrome/common/render_messages.h" | 24 #include "chrome/common/render_messages.h" |
| 25 #include "chrome/common/socket_stream_dispatcher.h" | 25 #include "chrome/common/socket_stream_dispatcher.h" |
| 26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 27 #include "chrome/plugin/npobject_util.h" | 27 #include "chrome/plugin/npobject_util.h" |
| 28 #include "chrome/renderer/net/renderer_net_predictor.h" | 28 #include "chrome/renderer/net/renderer_net_predictor.h" |
| 29 #include "chrome/renderer/render_process.h" | 29 #include "chrome/renderer/render_process.h" |
| 30 #include "chrome/renderer/render_thread.h" | 30 #include "chrome/renderer/render_thread.h" |
| 31 #include "googleurl/src/url_util.h" | 31 #include "googleurl/src/url_util.h" |
| 32 #include "third_party/skia/include/core/SkBitmap.h" | |
| 33 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
| 34 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" |
| 35 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 35 #include "third_party/skia/include/core/SkBitmap.h" |
| 36 #include "webkit/glue/scoped_clipboard_writer_glue.h" | 36 #include "webkit/glue/scoped_clipboard_writer_glue.h" |
| 37 #include "webkit/glue/webkit_glue.h" | 37 #include "webkit/glue/webkit_glue.h" |
| 38 #include "webkit/glue/websocketstreamhandle_bridge.h" | 38 #include "webkit/glue/websocketstreamhandle_bridge.h" |
| 39 | 39 |
| 40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 41 #include <strsafe.h> // note: per msdn docs, this must *follow* other includes | 41 #include <strsafe.h> // note: per msdn docs, this must *follow* other includes |
| 42 #elif defined(OS_LINUX) | 42 #elif defined(OS_LINUX) |
| 43 #include "chrome/renderer/renderer_sandbox_support_linux.h" | 43 #include "chrome/renderer/renderer_sandbox_support_linux.h" |
| 44 #endif | 44 #endif |
| 45 | 45 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 void SetCacheMode(bool enabled) { | 295 void SetCacheMode(bool enabled) { |
| 296 RenderThread::current()->SetCacheMode(enabled); | 296 RenderThread::current()->SetCacheMode(enabled); |
| 297 } | 297 } |
| 298 | 298 |
| 299 void ClearCache() { | 299 void ClearCache() { |
| 300 RenderThread::current()->ClearCache(); | 300 RenderThread::current()->ClearCache(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 std::string GetProductVersion() { | 303 std::string GetProductVersion() { |
| 304 scoped_ptr<FileVersionInfo> version_info( | 304 scoped_ptr<FileVersionInfo> version_info(chrome::GetChromeVersionInfo()); |
| 305 chrome_app::GetChromeVersionInfo()); | |
| 306 std::string product("Chrome/"); | 305 std::string product("Chrome/"); |
| 307 product += version_info.get() ? WideToASCII(version_info->product_version()) | 306 product += version_info.get() ? WideToASCII(version_info->product_version()) |
| 308 : "0.0.0.0"; | 307 : "0.0.0.0"; |
| 309 return product; | 308 return product; |
| 310 } | 309 } |
| 311 | 310 |
| 312 bool IsSingleProcess() { | 311 bool IsSingleProcess() { |
| 313 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); | 312 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); |
| 314 } | 313 } |
| 315 | 314 |
| 316 #if defined(OS_LINUX) | 315 #if defined(OS_LINUX) |
| 317 int MatchFontWithFallback(const std::string& face, bool bold, | 316 int MatchFontWithFallback(const std::string& face, bool bold, |
| 318 bool italic, int charset) { | 317 bool italic, int charset) { |
| 319 return renderer_sandbox_support::MatchFontWithFallback( | 318 return renderer_sandbox_support::MatchFontWithFallback( |
| 320 face, bold, italic, charset); | 319 face, bold, italic, charset); |
| 321 } | 320 } |
| 322 | 321 |
| 323 bool GetFontTable(int fd, uint32_t table, uint8_t* output, | 322 bool GetFontTable(int fd, uint32_t table, uint8_t* output, |
| 324 size_t* output_length) { | 323 size_t* output_length) { |
| 325 return renderer_sandbox_support::GetFontTable( | 324 return renderer_sandbox_support::GetFontTable( |
| 326 fd, table, output, output_length); | 325 fd, table, output, output_length); |
| 327 } | 326 } |
| 328 #endif | 327 #endif |
| 329 | 328 |
| 330 } // namespace webkit_glue | 329 } // namespace webkit_glue |
| OLD | NEW |