| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 #include "core/page/ContextMenuController.h" | 104 #include "core/page/ContextMenuController.h" |
| 105 #include "core/page/DragController.h" | 105 #include "core/page/DragController.h" |
| 106 #include "core/page/DragData.h" | 106 #include "core/page/DragData.h" |
| 107 #include "core/page/DragSession.h" | 107 #include "core/page/DragSession.h" |
| 108 #include "core/page/EventHandler.h" | 108 #include "core/page/EventHandler.h" |
| 109 #include "core/page/FocusController.h" | 109 #include "core/page/FocusController.h" |
| 110 #include "core/page/FrameTree.h" | 110 #include "core/page/FrameTree.h" |
| 111 #include "core/page/InjectedStyleSheets.h" | 111 #include "core/page/InjectedStyleSheets.h" |
| 112 #include "core/page/Page.h" | 112 #include "core/page/Page.h" |
| 113 #include "core/page/PageGroup.h" | 113 #include "core/page/PageGroup.h" |
| 114 #include "core/page/PageGroupLoadDeferrer.h" | |
| 115 #include "core/page/PagePopupClient.h" | 114 #include "core/page/PagePopupClient.h" |
| 116 #include "core/page/PointerLockController.h" | 115 #include "core/page/PointerLockController.h" |
| 116 #include "core/page/ScopedPageLoadDeferrer.h" |
| 117 #include "core/page/TouchDisambiguation.h" | 117 #include "core/page/TouchDisambiguation.h" |
| 118 #include "core/rendering/RenderLayerCompositor.h" | 118 #include "core/rendering/RenderLayerCompositor.h" |
| 119 #include "core/rendering/RenderView.h" | 119 #include "core/rendering/RenderView.h" |
| 120 #include "core/rendering/RenderWidget.h" | 120 #include "core/rendering/RenderWidget.h" |
| 121 #include "core/rendering/TextAutosizer.h" | 121 #include "core/rendering/TextAutosizer.h" |
| 122 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" | 122 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" |
| 123 #include "modules/geolocation/GeolocationController.h" | 123 #include "modules/geolocation/GeolocationController.h" |
| 124 #include "modules/indexeddb/InspectorIndexedDBAgent.h" | 124 #include "modules/indexeddb/InspectorIndexedDBAgent.h" |
| 125 #include "modules/notifications/NotificationController.h" | 125 #include "modules/notifications/NotificationController.h" |
| 126 #include "painting/ContinuousPainter.h" | 126 #include "painting/ContinuousPainter.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // Change the text zoom level by kTextSizeMultiplierRatio each time the user | 195 // Change the text zoom level by kTextSizeMultiplierRatio each time the user |
| 196 // zooms text in or out (ie., change by 20%). The min and max values limit | 196 // zooms text in or out (ie., change by 20%). The min and max values limit |
| 197 // text zoom to half and 3x the original text size. These three values match | 197 // text zoom to half and 3x the original text size. These three values match |
| 198 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm | 198 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm |
| 199 const double WebView::textSizeMultiplierRatio = 1.2; | 199 const double WebView::textSizeMultiplierRatio = 1.2; |
| 200 const double WebView::minTextSizeMultiplier = 0.5; | 200 const double WebView::minTextSizeMultiplier = 0.5; |
| 201 const double WebView::maxTextSizeMultiplier = 3.0; | 201 const double WebView::maxTextSizeMultiplier = 3.0; |
| 202 | 202 |
| 203 // Used to defer all page activity in cases where the embedder wishes to run | 203 // Used to defer all page activity in cases where the embedder wishes to run |
| 204 // a nested event loop. Using a stack enables nesting of message loop invocation
s. | 204 // a nested event loop. Using a stack enables nesting of message loop invocation
s. |
| 205 static Vector<PageGroupLoadDeferrer*>& pageGroupLoadDeferrerStack() | 205 static Vector<ScopedPageLoadDeferrer*>& pageLoadDeferrerStack() |
| 206 { | 206 { |
| 207 DEFINE_STATIC_LOCAL(Vector<PageGroupLoadDeferrer*>, deferrerStack, ()); | 207 DEFINE_STATIC_LOCAL(Vector<ScopedPageLoadDeferrer*>, deferrerStack, ()); |
| 208 return deferrerStack; | 208 return deferrerStack; |
| 209 } | 209 } |
| 210 | 210 |
| 211 // Ensure that the WebDragOperation enum values stay in sync with the original | 211 // Ensure that the WebDragOperation enum values stay in sync with the original |
| 212 // DragOperation constants. | 212 // DragOperation constants. |
| 213 #define COMPILE_ASSERT_MATCHING_ENUM(coreName) \ | 213 #define COMPILE_ASSERT_MATCHING_ENUM(coreName) \ |
| 214 COMPILE_ASSERT(int(coreName) == int(Web##coreName), dummy##coreName) | 214 COMPILE_ASSERT(int(coreName) == int(Web##coreName), dummy##coreName) |
| 215 COMPILE_ASSERT_MATCHING_ENUM(DragOperationNone); | 215 COMPILE_ASSERT_MATCHING_ENUM(DragOperationNone); |
| 216 COMPILE_ASSERT_MATCHING_ENUM(DragOperationCopy); | 216 COMPILE_ASSERT_MATCHING_ENUM(DragOperationCopy); |
| 217 COMPILE_ASSERT_MATCHING_ENUM(DragOperationLink); | 217 COMPILE_ASSERT_MATCHING_ENUM(DragOperationLink); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 Page::visitedStateChanged(linkHash); | 261 Page::visitedStateChanged(linkHash); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void WebView::resetVisitedLinkState() | 264 void WebView::resetVisitedLinkState() |
| 265 { | 265 { |
| 266 Page::allVisitedStateChanged(); | 266 Page::allVisitedStateChanged(); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void WebView::willEnterModalLoop() | 269 void WebView::willEnterModalLoop() |
| 270 { | 270 { |
| 271 PageGroup* pageGroup = PageGroup::sharedGroup(); | 271 pageLoadDeferrerStack().append(new ScopedPageLoadDeferrer()); |
| 272 if (pageGroup->pages().isEmpty()) | |
| 273 pageGroupLoadDeferrerStack().append(static_cast<PageGroupLoadDeferrer*>(
0)); | |
| 274 else { | |
| 275 // Pick any page in the page group since we are deferring all pages. | |
| 276 pageGroupLoadDeferrerStack().append(new PageGroupLoadDeferrer(*pageGroup
->pages().begin(), true)); | |
| 277 } | |
| 278 } | 272 } |
| 279 | 273 |
| 280 void WebView::didExitModalLoop() | 274 void WebView::didExitModalLoop() |
| 281 { | 275 { |
| 282 ASSERT(pageGroupLoadDeferrerStack().size()); | 276 ASSERT(pageLoadDeferrerStack().size()); |
| 283 | 277 |
| 284 delete pageGroupLoadDeferrerStack().last(); | 278 delete pageLoadDeferrerStack().last(); |
| 285 pageGroupLoadDeferrerStack().removeLast(); | 279 pageLoadDeferrerStack().removeLast(); |
| 286 } | 280 } |
| 287 | 281 |
| 288 void WebViewImpl::setMainFrame(WebFrame* frame) | 282 void WebViewImpl::setMainFrame(WebFrame* frame) |
| 289 { | 283 { |
| 290 toWebFrameImpl(frame)->initializeAsMainFrame(page()); | 284 toWebFrameImpl(frame)->initializeAsMainFrame(page()); |
| 291 } | 285 } |
| 292 | 286 |
| 293 void WebViewImpl::setAutofillClient(WebAutofillClient* autofillClient) | 287 void WebViewImpl::setAutofillClient(WebAutofillClient* autofillClient) |
| 294 { | 288 { |
| 295 m_autofillClient = autofillClient; | 289 m_autofillClient = autofillClient; |
| (...skipping 3694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3990 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3984 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 3991 | 3985 |
| 3992 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3986 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 3993 return false; | 3987 return false; |
| 3994 | 3988 |
| 3995 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 3989 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 3996 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 3990 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 3997 } | 3991 } |
| 3998 | 3992 |
| 3999 } // namespace blink | 3993 } // namespace blink |
| OLD | NEW |