| 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 "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <mlang.h> | 8 #include <mlang.h> |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 DumpLeakedObject(__FILE__, __LINE__, "WebFrame", count); | 260 DumpLeakedObject(__FILE__, __LINE__, "WebFrame", count); |
| 261 #endif | 261 #endif |
| 262 } | 262 } |
| 263 | 263 |
| 264 bool DecodeImage(const std::string& image_data, SkBitmap* image) { | 264 bool DecodeImage(const std::string& image_data, SkBitmap* image) { |
| 265 WebData web_data(image_data.data(), image_data.length()); | 265 WebData web_data(image_data.data(), image_data.length()); |
| 266 WebImage web_image(WebImage::fromData(web_data, WebSize())); | 266 WebImage web_image(WebImage::fromData(web_data, WebSize())); |
| 267 if (web_image.isNull()) | 267 if (web_image.isNull()) |
| 268 return false; | 268 return false; |
| 269 | 269 |
| 270 #if defined(OS_MACOSX) && !defined(USE_SKIA) | |
| 271 *image = gfx::CGImageToSkBitmap(web_image.getCGImageRef()); | |
| 272 #else | |
| 273 *image = web_image.getSkBitmap(); | 270 *image = web_image.getSkBitmap(); |
| 274 #endif | |
| 275 return true; | 271 return true; |
| 276 } | 272 } |
| 277 | 273 |
| 278 void PlatformFileInfoToWebFileInfo( | 274 void PlatformFileInfoToWebFileInfo( |
| 279 const base::PlatformFileInfo& file_info, | 275 const base::PlatformFileInfo& file_info, |
| 280 WebKit::WebFileInfo* web_file_info) { | 276 WebKit::WebFileInfo* web_file_info) { |
| 281 DCHECK(web_file_info); | 277 DCHECK(web_file_info); |
| 282 // WebKit now expects NaN as uninitialized/null Date. | 278 // WebKit now expects NaN as uninitialized/null Date. |
| 283 if (file_info.last_modified.is_null()) | 279 if (file_info.last_modified.is_null()) |
| 284 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); | 280 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 base::GetCurrentProcessHandle())); | 366 base::GetCurrentProcessHandle())); |
| 371 return process_metrics->GetPagefileUsage() >> 10; | 367 return process_metrics->GetPagefileUsage() >> 10; |
| 372 } | 368 } |
| 373 #endif | 369 #endif |
| 374 | 370 |
| 375 double ZoomFactorToZoomLevel(double factor) { | 371 double ZoomFactorToZoomLevel(double factor) { |
| 376 return WebView::zoomFactorToZoomLevel(factor); | 372 return WebView::zoomFactorToZoomLevel(factor); |
| 377 } | 373 } |
| 378 | 374 |
| 379 } // namespace webkit_glue | 375 } // namespace webkit_glue |
| OLD | NEW |