| 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 "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "third_party/WebKit/public/web/WebViewClient.h" | 51 #include "third_party/WebKit/public/web/WebViewClient.h" |
| 52 #include "third_party/skia/include/core/SkCanvas.h" | 52 #include "third_party/skia/include/core/SkCanvas.h" |
| 53 #include "ui/base/resource/resource_bundle.h" | 53 #include "ui/base/resource/resource_bundle.h" |
| 54 | 54 |
| 55 using content::WebPreferences; | 55 using content::WebPreferences; |
| 56 | 56 |
| 57 namespace printing { | 57 namespace printing { |
| 58 | 58 |
| 59 namespace { | 59 namespace { |
| 60 | 60 |
| 61 #define STATIC_ASSERT_PP_MATCHING_ENUM(a, b) \ | 61 #define STATIC_ASSERT_ENUM(a, b) \ |
| 62 static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 62 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| 63 "mismatching enums: " #a) | 63 "mismatching enums: " #a) |
| 64 | 64 |
| 65 // Check blink::WebDuplexMode and printing::DuplexMode are kept in sync. | 65 // Check blink and printing enums are kept in sync. |
| 66 STATIC_ASSERT_PP_MATCHING_ENUM(blink::WebUnknownDuplexMode, | 66 STATIC_ASSERT_ENUM(blink::WebUnknownDuplexMode, UNKNOWN_DUPLEX_MODE); |
| 67 UNKNOWN_DUPLEX_MODE); | 67 STATIC_ASSERT_ENUM(blink::WebSimplex, SIMPLEX); |
| 68 STATIC_ASSERT_PP_MATCHING_ENUM(blink::WebSimplex, SIMPLEX); | 68 STATIC_ASSERT_ENUM(blink::WebLongEdge, LONG_EDGE); |
| 69 STATIC_ASSERT_PP_MATCHING_ENUM(blink::WebLongEdge, LONG_EDGE); | 69 STATIC_ASSERT_ENUM(blink::WebShortEdge, SHORT_EDGE); |
| 70 STATIC_ASSERT_PP_MATCHING_ENUM(blink::WebShortEdge, SHORT_EDGE); | |
| 71 | 70 |
| 72 enum PrintPreviewHelperEvents { | 71 enum PrintPreviewHelperEvents { |
| 73 PREVIEW_EVENT_REQUESTED, | 72 PREVIEW_EVENT_REQUESTED, |
| 74 PREVIEW_EVENT_CACHE_HIT, // Unused | 73 PREVIEW_EVENT_CACHE_HIT, // Unused |
| 75 PREVIEW_EVENT_CREATE_DOCUMENT, | 74 PREVIEW_EVENT_CREATE_DOCUMENT, |
| 76 PREVIEW_EVENT_NEW_SETTINGS, // Unused | 75 PREVIEW_EVENT_NEW_SETTINGS, // Unused |
| 77 PREVIEW_EVENT_MAX, | 76 PREVIEW_EVENT_MAX, |
| 78 }; | 77 }; |
| 79 | 78 |
| 80 const double kMinDpi = 1.0; | 79 const double kMinDpi = 1.0; |
| (...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 blink::WebConsoleMessage::LevelWarning, message)); | 2248 blink::WebConsoleMessage::LevelWarning, message)); |
| 2250 return false; | 2249 return false; |
| 2251 } | 2250 } |
| 2252 | 2251 |
| 2253 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2252 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
| 2254 // Reset counter on successful print. | 2253 // Reset counter on successful print. |
| 2255 count_ = 0; | 2254 count_ = 0; |
| 2256 } | 2255 } |
| 2257 | 2256 |
| 2258 } // namespace printing | 2257 } // namespace printing |
| OLD | NEW |