| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "sky/engine/core/events/KeyboardEvent.h" | 46 #include "sky/engine/core/events/KeyboardEvent.h" |
| 47 #include "sky/engine/core/events/WheelEvent.h" | 47 #include "sky/engine/core/events/WheelEvent.h" |
| 48 #include "sky/engine/core/frame/FrameHost.h" | 48 #include "sky/engine/core/frame/FrameHost.h" |
| 49 #include "sky/engine/core/frame/FrameView.h" | 49 #include "sky/engine/core/frame/FrameView.h" |
| 50 #include "sky/engine/core/frame/LocalFrame.h" | 50 #include "sky/engine/core/frame/LocalFrame.h" |
| 51 #include "sky/engine/core/frame/Settings.h" | 51 #include "sky/engine/core/frame/Settings.h" |
| 52 #include "sky/engine/core/html/HTMLImportElement.h" | 52 #include "sky/engine/core/html/HTMLImportElement.h" |
| 53 #include "sky/engine/core/html/ime/InputMethodContext.h" | 53 #include "sky/engine/core/html/ime/InputMethodContext.h" |
| 54 #include "sky/engine/core/loader/FrameLoader.h" | 54 #include "sky/engine/core/loader/FrameLoader.h" |
| 55 #include "sky/engine/core/loader/UniqueIdentifier.h" | 55 #include "sky/engine/core/loader/UniqueIdentifier.h" |
| 56 #include "sky/engine/core/page/AutoscrollController.h" |
| 56 #include "sky/engine/core/page/Chrome.h" | 57 #include "sky/engine/core/page/Chrome.h" |
| 57 #include "sky/engine/core/page/EventHandler.h" | 58 #include "sky/engine/core/page/EventHandler.h" |
| 58 #include "sky/engine/core/page/EventWithHitTestResults.h" | 59 #include "sky/engine/core/page/EventWithHitTestResults.h" |
| 59 #include "sky/engine/core/page/FocusController.h" | 60 #include "sky/engine/core/page/FocusController.h" |
| 60 #include "sky/engine/core/page/Page.h" | 61 #include "sky/engine/core/page/Page.h" |
| 61 #include "sky/engine/core/page/TouchDisambiguation.h" | 62 #include "sky/engine/core/page/TouchDisambiguation.h" |
| 62 #include "sky/engine/core/rendering/RenderView.h" | 63 #include "sky/engine/core/rendering/RenderView.h" |
| 63 #include "sky/engine/platform/Cursor.h" | 64 #include "sky/engine/platform/Cursor.h" |
| 64 #include "sky/engine/platform/KeyboardCodes.h" | 65 #include "sky/engine/platform/KeyboardCodes.h" |
| 65 #include "sky/engine/platform/Logging.h" | 66 #include "sky/engine/platform/Logging.h" |
| 66 #include "sky/engine/platform/NotImplemented.h" | 67 #include "sky/engine/platform/NotImplemented.h" |
| 67 #include "sky/engine/platform/PlatformGestureEvent.h" | 68 #include "sky/engine/platform/PlatformGestureEvent.h" |
| 68 #include "sky/engine/platform/PlatformKeyboardEvent.h" | 69 #include "sky/engine/platform/PlatformKeyboardEvent.h" |
| 69 #include "sky/engine/platform/PlatformMouseEvent.h" | 70 #include "sky/engine/platform/PlatformMouseEvent.h" |
| 70 #include "sky/engine/platform/PlatformWheelEvent.h" | 71 #include "sky/engine/platform/PlatformWheelEvent.h" |
| 71 #include "sky/engine/platform/TraceEvent.h" | 72 #include "sky/engine/platform/TraceEvent.h" |
| 72 #include "sky/engine/platform/UserGestureIndicator.h" | 73 #include "sky/engine/platform/UserGestureIndicator.h" |
| 73 #include "sky/engine/platform/fonts/FontCache.h" | 74 #include "sky/engine/platform/fonts/FontCache.h" |
| 74 #include "sky/engine/platform/graphics/Color.h" | 75 #include "sky/engine/platform/graphics/Color.h" |
| 76 #include "sky/engine/platform/graphics/GraphicsContext.h" |
| 75 #include "sky/engine/platform/graphics/Image.h" | 77 #include "sky/engine/platform/graphics/Image.h" |
| 76 #include "sky/engine/platform/graphics/ImageBuffer.h" | 78 #include "sky/engine/platform/graphics/ImageBuffer.h" |
| 77 #include "sky/engine/platform/scroll/Scrollbar.h" | 79 #include "sky/engine/platform/scroll/Scrollbar.h" |
| 78 #include "sky/engine/public/platform/Platform.h" | 80 #include "sky/engine/public/platform/Platform.h" |
| 79 #include "sky/engine/public/platform/WebFloatPoint.h" | 81 #include "sky/engine/public/platform/WebFloatPoint.h" |
| 80 #include "sky/engine/public/platform/WebImage.h" | 82 #include "sky/engine/public/platform/WebImage.h" |
| 81 #include "sky/engine/public/platform/WebLayerTreeView.h" | 83 #include "sky/engine/public/platform/WebLayerTreeView.h" |
| 82 #include "sky/engine/public/platform/WebURLRequest.h" | 84 #include "sky/engine/public/platform/WebURLRequest.h" |
| 83 #include "sky/engine/public/platform/WebVector.h" | 85 #include "sky/engine/public/platform/WebVector.h" |
| 84 #include "sky/engine/public/web/WebActiveWheelFlingParameters.h" | 86 #include "sky/engine/public/web/WebActiveWheelFlingParameters.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 171 } |
| 170 | 172 |
| 171 WebLocalFrameImpl* WebViewImpl::mainFrameImpl() | 173 WebLocalFrameImpl* WebViewImpl::mainFrameImpl() |
| 172 { | 174 { |
| 173 return m_page ? WebLocalFrameImpl::fromFrame(m_page->mainFrame()) : 0; | 175 return m_page ? WebLocalFrameImpl::fromFrame(m_page->mainFrame()) : 0; |
| 174 } | 176 } |
| 175 | 177 |
| 176 void WebViewImpl::handleMouseLeave(LocalFrame& mainFrame, const WebMouseEvent& e
vent) | 178 void WebViewImpl::handleMouseLeave(LocalFrame& mainFrame, const WebMouseEvent& e
vent) |
| 177 { | 179 { |
| 178 m_client->setMouseOverURL(WebURL()); | 180 m_client->setMouseOverURL(WebURL()); |
| 179 PageWidgetEventHandler::handleMouseLeave(mainFrame, event); | 181 mainFrame.eventHandler().handleMouseLeaveEvent(PlatformMouseEventBuilder(mai
nFrame.view(), event)); |
| 180 } | 182 } |
| 181 | 183 |
| 182 void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
ent) | 184 void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
ent) |
| 183 { | 185 { |
| 184 PageWidgetEventHandler::handleMouseDown(mainFrame, event); | 186 mainFrame.eventHandler().handleMousePressEvent(PlatformMouseEventBuilder(mai
nFrame.view(), event)); |
| 185 | 187 |
| 186 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode) | 188 if (event.button == WebMouseEvent::ButtonLeft && m_mouseCaptureNode) |
| 187 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG
estureToken(); | 189 m_mouseCaptureGestureToken = mainFrame.eventHandler().takeLastMouseDownG
estureToken(); |
| 188 } | 190 } |
| 189 | 191 |
| 190 void WebViewImpl::handleMouseUp(LocalFrame& mainFrame, const WebMouseEvent& even
t) | 192 void WebViewImpl::handleMouseUp(LocalFrame& mainFrame, const WebMouseEvent& even
t) |
| 191 { | 193 { |
| 192 PageWidgetEventHandler::handleMouseUp(mainFrame, event); | 194 mainFrame.eventHandler().handleMouseReleaseEvent(PlatformMouseEventBuilder(m
ainFrame.view(), event)); |
| 193 } | 195 } |
| 194 | 196 |
| 195 bool WebViewImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEve
nt& event) | 197 bool WebViewImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEve
nt& event) |
| 196 { | 198 { |
| 197 return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); | 199 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); |
| 200 } |
| 201 |
| 202 void WebViewImpl::handleMouseMove(LocalFrame& mainFrame, const WebMouseEvent& ev
ent) |
| 203 { |
| 204 mainFrame.eventHandler().handleMouseMoveEvent(PlatformMouseEventBuilder(main
Frame.view(), event)); |
| 205 } |
| 206 |
| 207 bool WebViewImpl::handleTouchEvent(LocalFrame& mainFrame, const WebTouchEvent& e
vent) |
| 208 { |
| 209 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); |
| 198 } | 210 } |
| 199 | 211 |
| 200 bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) | 212 bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) |
| 201 { | 213 { |
| 202 bool eventSwallowed = false; | 214 bool eventSwallowed = false; |
| 203 bool eventCancelled = false; // for disambiguation | 215 bool eventCancelled = false; // for disambiguation |
| 204 | 216 |
| 205 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), even
t); | 217 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), even
t); |
| 206 | 218 |
| 207 // FIXME: Remove redundant hit tests by pushing the call to EventHandler::ta
rgetGestureEvent | 219 // FIXME: Remove redundant hit tests by pushing the call to EventHandler::ta
rgetGestureEvent |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 m_client = 0; | 480 m_client = 0; |
| 469 | 481 |
| 470 deref(); // Balances ref() acquired in WebView::create | 482 deref(); // Balances ref() acquired in WebView::create |
| 471 } | 483 } |
| 472 | 484 |
| 473 WebSize WebViewImpl::size() | 485 WebSize WebViewImpl::size() |
| 474 { | 486 { |
| 475 return m_size; | 487 return m_size; |
| 476 } | 488 } |
| 477 | 489 |
| 478 WebLocalFrameImpl* WebViewImpl::localFrameRootTemporary() const | |
| 479 { | |
| 480 // FIXME(sky): remove | |
| 481 return WebLocalFrameImpl::fromFrame(page()->mainFrame()); | |
| 482 } | |
| 483 | |
| 484 void WebViewImpl::performResize() | 490 void WebViewImpl::performResize() |
| 485 { | 491 { |
| 486 updateMainFrameLayoutSize(); | 492 updateMainFrameLayoutSize(); |
| 487 | 493 |
| 488 // If the virtual viewport pinch mode is enabled, the main frame will be res
ized | 494 // If the virtual viewport pinch mode is enabled, the main frame will be res
ized |
| 489 // after layout so it can be sized to the contentsSize. | 495 // after layout so it can be sized to the contentsSize. |
| 490 if (localFrameRootTemporary()->frameView()) | 496 if (FrameView* view = m_page->mainFrame()->view()) |
| 491 localFrameRootTemporary()->frameView()->resize(m_size); | 497 view->resize(m_size); |
| 492 } | 498 } |
| 493 | 499 |
| 494 void WebViewImpl::resize(const WebSize& newSize) | 500 void WebViewImpl::resize(const WebSize& newSize) |
| 495 { | 501 { |
| 496 if (m_size == newSize) | 502 if (m_size == newSize) |
| 497 return; | 503 return; |
| 498 | 504 |
| 499 FrameView* view = localFrameRootTemporary()->frameView(); | 505 FrameView* view = m_page->mainFrame()->view(); |
| 500 if (!view) | 506 if (!view) |
| 501 return; | 507 return; |
| 502 | 508 |
| 503 m_size = newSize; | 509 m_size = newSize; |
| 504 performResize(); | 510 performResize(); |
| 505 sendResizeEventAndRepaint(); | 511 sendResizeEventAndRepaint(); |
| 506 } | 512 } |
| 507 | 513 |
| 508 void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime) | 514 void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime) |
| 509 { | 515 { |
| 510 TRACE_EVENT0("blink", "WebViewImpl::beginFrame"); | 516 TRACE_EVENT0("blink", "WebViewImpl::beginFrame"); |
| 511 | 517 |
| 512 WebBeginFrameArgs validFrameTime(frameTime); | 518 WebBeginFrameArgs validFrameTime(frameTime); |
| 513 if (!validFrameTime.lastFrameTimeMonotonic) | 519 if (!validFrameTime.lastFrameTimeMonotonic) |
| 514 validFrameTime.lastFrameTimeMonotonic = monotonicallyIncreasingTime(); | 520 validFrameTime.lastFrameTimeMonotonic = monotonicallyIncreasingTime(); |
| 515 | 521 |
| 516 WTF_LOG(ScriptedAnimationController, "WebViewImpl::beginFrame: page = %d", !
m_page ? 0 : 1); | 522 WTF_LOG(ScriptedAnimationController, "WebViewImpl::beginFrame: page = %d", !
m_page ? 0 : 1); |
| 517 if (!m_page) | 523 if (!m_page) |
| 518 return; | 524 return; |
| 519 | 525 |
| 520 PageWidgetDelegate::animate(m_page.get(), validFrameTime.lastFrameTimeMonoto
nic); | 526 RefPtr<FrameView> view = m_page->mainFrame()->view(); |
| 527 if (!view) |
| 528 return; |
| 529 m_page->autoscrollController().animate(validFrameTime.lastFrameTimeMonotonic
); |
| 530 m_page->animator().serviceScriptedAnimations(validFrameTime.lastFrameTimeMon
otonic); |
| 521 } | 531 } |
| 522 | 532 |
| 523 void WebViewImpl::layout() | 533 void WebViewImpl::layout() |
| 524 { | 534 { |
| 525 TRACE_EVENT0("blink", "WebViewImpl::layout"); | 535 TRACE_EVENT0("blink", "WebViewImpl::layout"); |
| 526 if (!localFrameRootTemporary()) | 536 if (!m_page) |
| 527 return; | 537 return; |
| 528 PageWidgetDelegate::layout(m_page.get(), localFrameRootTemporary()->frame())
; | 538 m_page->animator().updateLayoutAndStyleForPainting(m_page->mainFrame()); |
| 529 } | 539 } |
| 530 | 540 |
| 531 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) | 541 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) |
| 532 { | 542 { |
| 533 PageWidgetDelegate::paint(m_page.get(), canvas, rect, isTransparent() ? Page
WidgetDelegate::Translucent : PageWidgetDelegate::Opaque); | 543 if (rect.isEmpty()) |
| 544 return; |
| 545 GraphicsContext gc(canvas); |
| 546 gc.setCertainlyOpaque(!isTransparent()); |
| 547 gc.applyDeviceScaleFactor(m_page->deviceScaleFactor()); |
| 548 gc.setDeviceScaleFactor(m_page->deviceScaleFactor()); |
| 549 IntRect dirtyRect(rect); |
| 550 gc.save(); // Needed to save the canvas, not the GraphicsContext. |
| 551 FrameView* view = m_page->mainFrame()->view(); |
| 552 if (view) { |
| 553 gc.clip(dirtyRect); |
| 554 view->paint(&gc, dirtyRect); |
| 555 } else { |
| 556 gc.fillRect(dirtyRect, Color::white); |
| 557 } |
| 558 gc.restore(); |
| 534 } | 559 } |
| 535 | 560 |
| 536 const WebInputEvent* WebViewImpl::m_currentInputEvent = 0; | 561 const WebInputEvent* WebViewImpl::m_currentInputEvent = 0; |
| 537 | 562 |
| 538 // FIXME: autogenerate this kind of code, and use it throughout Blink rather tha
n | 563 // FIXME: autogenerate this kind of code, and use it throughout Blink rather tha
n |
| 539 // the one-offs for subsets of these values. | 564 // the one-offs for subsets of these values. |
| 540 static String inputTypeToName(WebInputEvent::Type type) | 565 static String inputTypeToName(WebInputEvent::Type type) |
| 541 { | 566 { |
| 542 switch (type) { | 567 switch (type) { |
| 543 case WebInputEvent::MouseDown: | 568 case WebInputEvent::MouseDown: |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 default: | 645 default: |
| 621 ASSERT_NOT_REACHED(); | 646 ASSERT_NOT_REACHED(); |
| 622 } | 647 } |
| 623 | 648 |
| 624 node->dispatchMouseEvent( | 649 node->dispatchMouseEvent( |
| 625 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast<
const WebMouseEvent&>(inputEvent)), | 650 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast<
const WebMouseEvent&>(inputEvent)), |
| 626 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; | 651 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; |
| 627 return true; | 652 return true; |
| 628 } | 653 } |
| 629 | 654 |
| 630 return PageWidgetDelegate::handleInputEvent(m_page.get(), *this, inputEvent)
; | 655 LocalFrame* frame = m_page ? m_page->mainFrame() : nullptr; |
| 656 switch (inputEvent.type) { |
| 657 |
| 658 // FIXME: WebKit seems to always return false on mouse events processing |
| 659 // methods. For now we'll assume it has processed them (as we are only |
| 660 // interested in whether keyboard events are processed). |
| 661 case WebInputEvent::MouseMove: |
| 662 if (!frame || !frame->view()) |
| 663 return true; |
| 664 handleMouseMove(*frame, static_cast<const WebMouseEvent&>(inputEvent)); |
| 665 return true; |
| 666 case WebInputEvent::MouseLeave: |
| 667 if (!frame || !frame->view()) |
| 668 return true; |
| 669 handleMouseLeave(*frame, static_cast<const WebMouseEvent&>(inputEvent)); |
| 670 return true; |
| 671 case WebInputEvent::MouseDown: |
| 672 if (!frame || !frame->view()) |
| 673 return true; |
| 674 handleMouseDown(*frame, static_cast<const WebMouseEvent&>(inputEvent)); |
| 675 return true; |
| 676 case WebInputEvent::MouseUp: |
| 677 if (!frame || !frame->view()) |
| 678 return true; |
| 679 handleMouseUp(*frame, static_cast<const WebMouseEvent&>(inputEvent)); |
| 680 return true; |
| 681 |
| 682 case WebInputEvent::MouseWheel: |
| 683 if (!frame || !frame->view()) |
| 684 return false; |
| 685 return handleMouseWheel(*frame, static_cast<const WebMouseWheelEvent&>(i
nputEvent)); |
| 686 |
| 687 case WebInputEvent::RawKeyDown: |
| 688 case WebInputEvent::KeyDown: |
| 689 case WebInputEvent::KeyUp: |
| 690 return handleKeyEvent(static_cast<const WebKeyboardEvent&>(inputEvent)); |
| 691 |
| 692 case WebInputEvent::Char: |
| 693 return handleCharEvent(static_cast<const WebKeyboardEvent&>(inputEvent))
; |
| 694 case WebInputEvent::GestureScrollBegin: |
| 695 case WebInputEvent::GestureScrollEnd: |
| 696 case WebInputEvent::GestureScrollUpdate: |
| 697 case WebInputEvent::GestureScrollUpdateWithoutPropagation: |
| 698 case WebInputEvent::GestureFlingStart: |
| 699 case WebInputEvent::GestureFlingCancel: |
| 700 case WebInputEvent::GestureTap: |
| 701 case WebInputEvent::GestureTapUnconfirmed: |
| 702 case WebInputEvent::GestureTapDown: |
| 703 case WebInputEvent::GestureShowPress: |
| 704 case WebInputEvent::GestureTapCancel: |
| 705 case WebInputEvent::GestureDoubleTap: |
| 706 case WebInputEvent::GestureTwoFingerTap: |
| 707 case WebInputEvent::GestureLongPress: |
| 708 case WebInputEvent::GestureLongTap: |
| 709 return handleGestureEvent(static_cast<const WebGestureEvent&>(inputEvent
)); |
| 710 |
| 711 case WebInputEvent::TouchStart: |
| 712 case WebInputEvent::TouchMove: |
| 713 case WebInputEvent::TouchEnd: |
| 714 case WebInputEvent::TouchCancel: |
| 715 if (!frame || !frame->view()) |
| 716 return false; |
| 717 return handleTouchEvent(*frame, static_cast<const WebTouchEvent&>(inputE
vent)); |
| 718 |
| 719 case WebInputEvent::GesturePinchBegin: |
| 720 case WebInputEvent::GesturePinchEnd: |
| 721 case WebInputEvent::GesturePinchUpdate: |
| 722 // FIXME: Once PlatformGestureEvent is updated to support pinch, this |
| 723 // should call handleGestureEvent, just like it currently does for |
| 724 // gesture scroll. |
| 725 return false; |
| 726 |
| 727 default: |
| 728 return false; |
| 729 } |
| 631 } | 730 } |
| 632 | 731 |
| 633 void WebViewImpl::mouseCaptureLost() | 732 void WebViewImpl::mouseCaptureLost() |
| 634 { | 733 { |
| 635 TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this); | 734 TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this); |
| 636 m_mouseCaptureNode = nullptr; | 735 m_mouseCaptureNode = nullptr; |
| 637 } | 736 } |
| 638 | 737 |
| 639 void WebViewImpl::setFocus(bool enable) | 738 void WebViewImpl::setFocus(bool enable) |
| 640 { | 739 { |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 | 1193 |
| 1095 LocalFrame* frame = m_page->mainFrame(); | 1194 LocalFrame* frame = m_page->mainFrame(); |
| 1096 frame->removeSpellingMarkersUnderWords(convertedWords); | 1195 frame->removeSpellingMarkersUnderWords(convertedWords); |
| 1097 } | 1196 } |
| 1098 | 1197 |
| 1099 void WebViewImpl::sendResizeEventAndRepaint() | 1198 void WebViewImpl::sendResizeEventAndRepaint() |
| 1100 { | 1199 { |
| 1101 // FIXME: This is wrong. The FrameView is responsible sending a resizeEvent | 1200 // FIXME: This is wrong. The FrameView is responsible sending a resizeEvent |
| 1102 // as part of layout. Layout is also responsible for sending invalidations | 1201 // as part of layout. Layout is also responsible for sending invalidations |
| 1103 // to the embedder. This method and all callers may be wrong. -- eseidel. | 1202 // to the embedder. This method and all callers may be wrong. -- eseidel. |
| 1104 if (localFrameRootTemporary()->frameView()) { | 1203 if (m_page->mainFrame()->view()) { |
| 1105 // Enqueues the resize event. | 1204 // Enqueues the resize event. |
| 1106 localFrameRootTemporary()->frame()->document()->enqueueResizeEvent(); | 1205 m_page->mainFrame()->document()->enqueueResizeEvent(); |
| 1107 } | 1206 } |
| 1108 } | 1207 } |
| 1109 | 1208 |
| 1110 void WebViewImpl::setIsTransparent(bool isTransparent) | 1209 void WebViewImpl::setIsTransparent(bool isTransparent) |
| 1111 { | 1210 { |
| 1112 // Set any existing frames to be transparent. | 1211 // Set any existing frames to be transparent. |
| 1113 m_page->mainFrame()->view()->setTransparent(isTransparent); | 1212 m_page->mainFrame()->view()->setTransparent(isTransparent); |
| 1114 | 1213 |
| 1115 // Future frames check this to know whether to be transparent. | 1214 // Future frames check this to know whether to be transparent. |
| 1116 m_isTransparent = isTransparent; | 1215 m_isTransparent = isTransparent; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, | 1292 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, |
| 1194 bool isInitialState) { | 1293 bool isInitialState) { |
| 1195 if (!page()) | 1294 if (!page()) |
| 1196 return; | 1295 return; |
| 1197 | 1296 |
| 1198 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState =
= WebPageVisibilityStateHidden); | 1297 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState =
= WebPageVisibilityStateHidden); |
| 1199 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>
(visibilityState)), isInitialState); | 1298 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>
(visibilityState)), isInitialState); |
| 1200 } | 1299 } |
| 1201 | 1300 |
| 1202 } // namespace blink | 1301 } // namespace blink |
| OLD | NEW |