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 <objidl.h> | 8 #include <objidl.h> |
9 #include <mlang.h> | 9 #include <mlang.h> |
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "third_party/skia/include/core/SkBitmap.h" | 32 #include "third_party/skia/include/core/SkBitmap.h" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" |
35 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGlyphCache.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGlyphCache.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintParams.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintParams.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
48 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
49 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" | 50 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" |
50 #endif | 51 #endif |
51 #include "v8/include/v8.h" | 52 #include "v8/include/v8.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 return WebKit::WebFileErrorAbort; | 343 return WebKit::WebFileErrorAbort; |
343 case base::PLATFORM_FILE_ERROR_SECURITY: | 344 case base::PLATFORM_FILE_ERROR_SECURITY: |
344 return WebKit::WebFileErrorSecurity; | 345 return WebKit::WebFileErrorSecurity; |
345 case base::PLATFORM_FILE_ERROR_NO_SPACE: | 346 case base::PLATFORM_FILE_ERROR_NO_SPACE: |
346 return WebKit::WebFileErrorQuotaExceeded; | 347 return WebKit::WebFileErrorQuotaExceeded; |
347 default: | 348 default: |
348 return WebKit::WebFileErrorInvalidModification; | 349 return WebKit::WebFileErrorInvalidModification; |
349 } | 350 } |
350 } | 351 } |
351 | 352 |
| 353 void PlatformFileInfoToWebFileInfo( |
| 354 const base::PlatformFileInfo& file_info, |
| 355 WebKit::WebFileInfo* web_file_info) { |
| 356 DCHECK(web_file_info); |
| 357 web_file_info->modificationTime = file_info.last_modified.ToDoubleT(); |
| 358 web_file_info->length = file_info.size; |
| 359 if (file_info.is_directory) |
| 360 web_file_info->type = WebKit::WebFileInfo::TypeDirectory; |
| 361 else |
| 362 web_file_info->type = WebKit::WebFileInfo::TypeFile; |
| 363 } |
| 364 |
352 namespace { | 365 namespace { |
353 | 366 |
354 class UserAgentState { | 367 class UserAgentState { |
355 public: | 368 public: |
356 UserAgentState(); | 369 UserAgentState(); |
357 ~UserAgentState(); | 370 ~UserAgentState(); |
358 | 371 |
359 void Set(const std::string& user_agent, bool overriding); | 372 void Set(const std::string& user_agent, bool overriding); |
360 const std::string& Get(const GURL& url) const; | 373 const std::string& Get(const GURL& url) const; |
361 | 374 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 case WebKit::WebReferrerPolicyAlways: | 529 case WebKit::WebReferrerPolicyAlways: |
517 case WebKit::WebReferrerPolicyNever: | 530 case WebKit::WebReferrerPolicyNever: |
518 case WebKit::WebReferrerPolicyOrigin: | 531 case WebKit::WebReferrerPolicyOrigin: |
519 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; | 532 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; |
520 break; | 533 break; |
521 } | 534 } |
522 request->set_referrer_policy(net_referrer_policy); | 535 request->set_referrer_policy(net_referrer_policy); |
523 } | 536 } |
524 | 537 |
525 } // namespace webkit_glue | 538 } // namespace webkit_glue |
OLD | NEW |