| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // Used to defer all page activity in cases where the embedder wishes to run | 225 // Used to defer all page activity in cases where the embedder wishes to run |
| 226 // a nested event loop. Using a stack enables nesting of message loop invocation
s. | 226 // a nested event loop. Using a stack enables nesting of message loop invocation
s. |
| 227 static Vector<OwnPtr<ScopedPageLoadDeferrer>>& pageLoadDeferrerStack() | 227 static Vector<OwnPtr<ScopedPageLoadDeferrer>>& pageLoadDeferrerStack() |
| 228 { | 228 { |
| 229 DEFINE_STATIC_LOCAL(Vector<OwnPtr<ScopedPageLoadDeferrer>>, deferrerStack, (
)); | 229 DEFINE_STATIC_LOCAL(Vector<OwnPtr<ScopedPageLoadDeferrer>>, deferrerStack, (
)); |
| 230 return deferrerStack; | 230 return deferrerStack; |
| 231 } | 231 } |
| 232 | 232 |
| 233 // Ensure that the WebDragOperation enum values stay in sync with the original | 233 // Ensure that the WebDragOperation enum values stay in sync with the original |
| 234 // DragOperation constants. | 234 // DragOperation constants. |
| 235 #define STATIC_ASSERT_MATCHING_ENUM(coreName) \ | 235 #define STATIC_ASSERT_ENUM(a, b) \ |
| 236 static_assert(int(coreName) == int(Web##coreName), "DragOperation and WebDra
gOperation enum mismatch: " #coreName) | 236 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| 237 STATIC_ASSERT_MATCHING_ENUM(DragOperationNone); | 237 "mismatching enum : " #a) |
| 238 STATIC_ASSERT_MATCHING_ENUM(DragOperationCopy); | 238 STATIC_ASSERT_ENUM(DragOperationNone, WebDragOperationNone); |
| 239 STATIC_ASSERT_MATCHING_ENUM(DragOperationLink); | 239 STATIC_ASSERT_ENUM(DragOperationCopy, WebDragOperationCopy); |
| 240 STATIC_ASSERT_MATCHING_ENUM(DragOperationGeneric); | 240 STATIC_ASSERT_ENUM(DragOperationLink, WebDragOperationLink); |
| 241 STATIC_ASSERT_MATCHING_ENUM(DragOperationPrivate); | 241 STATIC_ASSERT_ENUM(DragOperationGeneric, WebDragOperationGeneric); |
| 242 STATIC_ASSERT_MATCHING_ENUM(DragOperationMove); | 242 STATIC_ASSERT_ENUM(DragOperationPrivate, WebDragOperationPrivate); |
| 243 STATIC_ASSERT_MATCHING_ENUM(DragOperationDelete); | 243 STATIC_ASSERT_ENUM(DragOperationMove, WebDragOperationMove); |
| 244 STATIC_ASSERT_MATCHING_ENUM(DragOperationEvery); | 244 STATIC_ASSERT_ENUM(DragOperationDelete, WebDragOperationDelete); |
| 245 STATIC_ASSERT_ENUM(DragOperationEvery, WebDragOperationEvery); |
| 245 | 246 |
| 246 static bool shouldUseExternalPopupMenus = false; | 247 static bool shouldUseExternalPopupMenus = false; |
| 247 | 248 |
| 248 namespace { | 249 namespace { |
| 249 | 250 |
| 250 class UserGestureNotifier { | 251 class UserGestureNotifier { |
| 251 public: | 252 public: |
| 252 // If a UserGestureIndicator is created for a user gesture since the last | 253 // If a UserGestureIndicator is created for a user gesture since the last |
| 253 // page load and *userGestureObserved is false, the UserGestureNotifier | 254 // page load and *userGestureObserved is false, the UserGestureNotifier |
| 254 // will notify the client and set *userGestureObserved to true. | 255 // will notify the client and set *userGestureObserved to true. |
| (...skipping 4306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4561 { | 4562 { |
| 4562 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4563 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4563 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4564 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4564 if (!page()) | 4565 if (!page()) |
| 4565 return 1; | 4566 return 1; |
| 4566 | 4567 |
| 4567 return page()->deviceScaleFactor(); | 4568 return page()->deviceScaleFactor(); |
| 4568 } | 4569 } |
| 4569 | 4570 |
| 4570 } // namespace blink | 4571 } // namespace blink |
| OLD | NEW |