Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 #include "skia/ext/skia_utils_mac.h" | 30 #include "skia/ext/skia_utils_mac.h" |
| 31 #endif | 31 #endif |
| 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/WebDevToolsAgent.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" |
| 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGlyphCache.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGlyphCache.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" |
|
darin (slow to review)
2012/05/17 19:13:03
nit: bonus points: consider re-sorting headers her
kmadhusu
2012/05/17 20:16:29
Done.
| |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintParams.h" | |
| 43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
| 43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
| 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 46 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 47 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact ory.h" | 49 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact ory.h" |
| 48 #endif | 50 #endif |
| 49 #include "v8/include/v8.h" | 51 #include "v8/include/v8.h" |
| 50 #include "webkit/glue/glue_serialize.h" | 52 #include "webkit/glue/glue_serialize.h" |
| 51 #include "webkit/glue/user_agent.h" | 53 #include "webkit/glue/user_agent.h" |
| 52 | 54 |
| 53 using WebKit::WebCanvas; | 55 using WebKit::WebCanvas; |
| 54 using WebKit::WebData; | 56 using WebKit::WebData; |
| 55 using WebKit::WebDevToolsAgent; | 57 using WebKit::WebDevToolsAgent; |
| 56 using WebKit::WebElement; | 58 using WebKit::WebElement; |
| 57 using WebKit::WebFrame; | 59 using WebKit::WebFrame; |
| 58 using WebKit::WebGlyphCache; | 60 using WebKit::WebGlyphCache; |
| 59 using WebKit::WebHistoryItem; | 61 using WebKit::WebHistoryItem; |
| 60 using WebKit::WebImage; | 62 using WebKit::WebImage; |
| 63 using WebKit::WebPrintParams; | |
| 64 using WebKit::WebRect; | |
| 61 using WebKit::WebSize; | 65 using WebKit::WebSize; |
| 62 using WebKit::WebString; | 66 using WebKit::WebString; |
| 63 using WebKit::WebVector; | 67 using WebKit::WebVector; |
| 64 using WebKit::WebView; | 68 using WebKit::WebView; |
| 65 | 69 |
| 66 static const char kLayoutTestsPattern[] = "/LayoutTests/"; | 70 static const char kLayoutTestsPattern[] = "/LayoutTests/"; |
| 67 static const std::string::size_type kLayoutTestsPatternSize = | 71 static const std::string::size_type kLayoutTestsPatternSize = |
| 68 arraysize(kLayoutTestsPattern) - 1; | 72 arraysize(kLayoutTestsPattern) - 1; |
| 69 static const char kFileUrlPattern[] = "file:/"; | 73 static const char kFileUrlPattern[] = "file:/"; |
| 70 static const char kDataUrlPattern[] = "data:"; | 74 static const char kDataUrlPattern[] = "data:"; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 return web_frame->pageNumberForElementById(WebString::fromUTF8(id), | 154 return web_frame->pageNumberForElementById(WebString::fromUTF8(id), |
| 151 page_width_in_pixels, | 155 page_width_in_pixels, |
| 152 page_height_in_pixels); | 156 page_height_in_pixels); |
| 153 } | 157 } |
| 154 | 158 |
| 155 int NumberOfPages(WebFrame* web_frame, | 159 int NumberOfPages(WebFrame* web_frame, |
| 156 float page_width_in_pixels, | 160 float page_width_in_pixels, |
| 157 float page_height_in_pixels) { | 161 float page_height_in_pixels) { |
| 158 WebSize size(static_cast<int>(page_width_in_pixels), | 162 WebSize size(static_cast<int>(page_width_in_pixels), |
| 159 static_cast<int>(page_height_in_pixels)); | 163 static_cast<int>(page_height_in_pixels)); |
| 160 int number_of_pages = web_frame->printBegin(size); | 164 |
| 165 WebPrintParams print_params; | |
| 166 print_params.paperSize = size; | |
| 167 print_params.printContentArea = WebRect(0, 0, size.width, size.height); | |
| 168 print_params.printableArea = WebRect(0, 0, size.width, size.height); | |
| 169 | |
| 170 int number_of_pages = web_frame->printBegin(print_params); | |
| 161 web_frame->printEnd(); | 171 web_frame->printEnd(); |
| 162 return number_of_pages; | 172 return number_of_pages; |
| 163 } | 173 } |
| 164 | 174 |
| 165 string16 DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { | 175 string16 DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { |
| 166 gfx::Size offset = web_frame->scrollOffset(); | 176 gfx::Size offset = web_frame->scrollOffset(); |
| 167 std::string result_utf8; | 177 std::string result_utf8; |
| 168 | 178 |
| 169 if (offset.width() > 0 || offset.height() > 0) { | 179 if (offset.width() > 0 || offset.height() > 0) { |
| 170 if (web_frame->parent()) { | 180 if (web_frame->parent()) { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 case WebKit::WebReferrerPolicyAlways: | 516 case WebKit::WebReferrerPolicyAlways: |
| 507 case WebKit::WebReferrerPolicyNever: | 517 case WebKit::WebReferrerPolicyNever: |
| 508 case WebKit::WebReferrerPolicyOrigin: | 518 case WebKit::WebReferrerPolicyOrigin: |
| 509 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; | 519 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; |
| 510 break; | 520 break; |
| 511 } | 521 } |
| 512 request->set_referrer_policy(net_referrer_policy); | 522 request->set_referrer_policy(net_referrer_policy); |
| 513 } | 523 } |
| 514 | 524 |
| 515 } // namespace webkit_glue | 525 } // namespace webkit_glue |
| OLD | NEW |