| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 #include "public/web/WebUserGestureToken.h" | 85 #include "public/web/WebUserGestureToken.h" |
| 86 #include "public/web/WebViewClient.h" | 86 #include "public/web/WebViewClient.h" |
| 87 #include "public/web/WebWindowFeatures.h" | 87 #include "public/web/WebWindowFeatures.h" |
| 88 #include "web/ColorChooserPopupUIController.h" | 88 #include "web/ColorChooserPopupUIController.h" |
| 89 #include "web/ColorChooserUIController.h" | 89 #include "web/ColorChooserUIController.h" |
| 90 #include "web/DateTimeChooserImpl.h" | 90 #include "web/DateTimeChooserImpl.h" |
| 91 #include "web/ExternalDateTimeChooser.h" | 91 #include "web/ExternalDateTimeChooser.h" |
| 92 #include "web/ExternalPopupMenu.h" | 92 #include "web/ExternalPopupMenu.h" |
| 93 #include "web/PopupMenuChromium.h" | 93 #include "web/PopupMenuChromium.h" |
| 94 #include "web/WebFileChooserCompletionImpl.h" | 94 #include "web/WebFileChooserCompletionImpl.h" |
| 95 #include "web/WebFrameWidgetImpl.h" |
| 95 #include "web/WebInputEventConversion.h" | 96 #include "web/WebInputEventConversion.h" |
| 96 #include "web/WebLocalFrameImpl.h" | 97 #include "web/WebLocalFrameImpl.h" |
| 97 #include "web/WebPluginContainerImpl.h" | 98 #include "web/WebPluginContainerImpl.h" |
| 98 #include "web/WebPopupMenuImpl.h" | 99 #include "web/WebPopupMenuImpl.h" |
| 99 #include "web/WebSettingsImpl.h" | 100 #include "web/WebSettingsImpl.h" |
| 100 #include "web/WebViewImpl.h" | 101 #include "web/WebViewImpl.h" |
| 101 #include "wtf/text/CString.h" | 102 #include "wtf/text/CString.h" |
| 102 #include "wtf/text/StringBuilder.h" | 103 #include "wtf/text/StringBuilder.h" |
| 103 #include "wtf/text/StringConcatenate.h" | 104 #include "wtf/text/StringConcatenate.h" |
| 104 #include "wtf/unicode/CharacterNames.h" | 105 #include "wtf/unicode/CharacterNames.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 return m_windowFeatures.menuBarVisible; | 355 return m_windowFeatures.menuBarVisible; |
| 355 } | 356 } |
| 356 | 357 |
| 357 void ChromeClientImpl::setResizable(bool value) | 358 void ChromeClientImpl::setResizable(bool value) |
| 358 { | 359 { |
| 359 m_windowFeatures.resizable = value; | 360 m_windowFeatures.resizable = value; |
| 360 } | 361 } |
| 361 | 362 |
| 362 bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) | 363 bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) |
| 363 { | 364 { |
| 364 WebLocalFrameImpl* webframe = m_webView->localFrameRootTemporary(); | 365 WebLocalFrameImpl* webframe = m_webView->mainFrameImpl(); |
| 365 return webframe->client() && webframe->client()->shouldReportDetailedMessage
ForSource(url); | 366 return webframe->client() && webframe->client()->shouldReportDetailedMessage
ForSource(url); |
| 366 } | 367 } |
| 367 | 368 |
| 368 void ChromeClientImpl::addMessageToConsole(LocalFrame* localFrame, MessageSource
source, MessageLevel level, const String& message, unsigned lineNumber, const S
tring& sourceID, const String& stackTrace) | 369 void ChromeClientImpl::addMessageToConsole(LocalFrame* localFrame, MessageSource
source, MessageLevel level, const String& message, unsigned lineNumber, const S
tring& sourceID, const String& stackTrace) |
| 369 { | 370 { |
| 370 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(localFrame); | 371 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(localFrame); |
| 371 if (frame && frame->client()) { | 372 if (frame && frame->client()) { |
| 372 frame->client()->didAddMessageToConsole( | 373 frame->client()->didAddMessageToConsole( |
| 373 WebConsoleMessage(static_cast<WebConsoleMessage::Level>(level), mess
age), | 374 WebConsoleMessage(static_cast<WebConsoleMessage::Level>(level), mess
age), |
| 374 sourceID, | 375 sourceID, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 invalidateContentsAndRootView(updateRect); | 486 invalidateContentsAndRootView(updateRect); |
| 486 } | 487 } |
| 487 | 488 |
| 488 void ChromeClientImpl::scheduleAnimation() | 489 void ChromeClientImpl::scheduleAnimation() |
| 489 { | 490 { |
| 490 m_webView->scheduleAnimation(); | 491 m_webView->scheduleAnimation(); |
| 491 } | 492 } |
| 492 | 493 |
| 493 void ChromeClientImpl::scheduleAnimationForFrame(LocalFrame* localRoot) | 494 void ChromeClientImpl::scheduleAnimationForFrame(LocalFrame* localRoot) |
| 494 { | 495 { |
| 495 // FIXME: This will proxy to a WebWidget attached to the WebLocalFrameImpl. | 496 ASSERT(WebLocalFrameImpl::fromFrame(localRoot)); |
| 496 scheduleAnimation(); | 497 // If the frame is still being created, it might not yet have a WebWidget. |
| 498 if (!WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()) |
| 499 scheduleAnimation(); |
| 500 else |
| 501 WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()->scheduleAnimatio
n(); |
| 497 } | 502 } |
| 498 | 503 |
| 499 IntRect ChromeClientImpl::rootViewToScreen(const IntRect& rect) const | 504 IntRect ChromeClientImpl::rootViewToScreen(const IntRect& rect) const |
| 500 { | 505 { |
| 501 IntRect screenRect(rect); | 506 IntRect screenRect(rect); |
| 502 | 507 |
| 503 if (m_webView->client()) { | 508 if (m_webView->client()) { |
| 504 WebRect windowRect = m_webView->client()->windowRect(); | 509 WebRect windowRect = m_webView->client()->windowRect(); |
| 505 screenRect.move(windowRect.x, windowRect.y); | 510 screenRect.move(windowRect.x, windowRect.y); |
| 506 } | 511 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 return false; | 693 return false; |
| 689 } | 694 } |
| 690 | 695 |
| 691 GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const | 696 GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const |
| 692 { | 697 { |
| 693 return m_webView->graphicsLayerFactory(); | 698 return m_webView->graphicsLayerFactory(); |
| 694 } | 699 } |
| 695 | 700 |
| 696 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
ame* localRoot) | 701 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
ame* localRoot) |
| 697 { | 702 { |
| 698 // FIXME: Add call to frame's widget for non-zero frames. | 703 // FIXME: For top-level frames we still use the WebView as a WebWidget. This
special |
| 699 m_webView->setRootGraphicsLayer(rootLayer); | 704 // case will be removed when top-level frames get WebFrameWidgets. |
| 705 if (localRoot->isMainFrame()) { |
| 706 m_webView->setRootGraphicsLayer(rootLayer); |
| 707 } else { |
| 708 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); |
| 709 // FIXME: The following conditional is only needed for staging until the
Chromium patch |
| 710 // lands that instantiates a WebFrameWidget. |
| 711 if (!webFrame->frameWidget()) { |
| 712 m_webView->setRootGraphicsLayer(rootLayer); |
| 713 return; |
| 714 } |
| 715 ASSERT(webFrame && webFrame->frameWidget()); |
| 716 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer); |
| 717 } |
| 700 } | 718 } |
| 701 | 719 |
| 702 void ChromeClientImpl::enterFullScreenForElement(Element* element) | 720 void ChromeClientImpl::enterFullScreenForElement(Element* element) |
| 703 { | 721 { |
| 704 m_webView->enterFullScreenForElement(element); | 722 m_webView->enterFullScreenForElement(element); |
| 705 } | 723 } |
| 706 | 724 |
| 707 void ChromeClientImpl::exitFullScreenForElement(Element* element) | 725 void ChromeClientImpl::exitFullScreenForElement(Element* element) |
| 708 { | 726 { |
| 709 m_webView->exitFullScreenForElement(element); | 727 m_webView->exitFullScreenForElement(element); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 { | 881 { |
| 864 // FIXME: remove. See http://crbug.com/425756 | 882 // FIXME: remove. See http://crbug.com/425756 |
| 865 if (m_webView->autofillClient()) | 883 if (m_webView->autofillClient()) |
| 866 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in
put)); | 884 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in
put)); |
| 867 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document().
frame()); | 885 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document().
frame()); |
| 868 if (webframe->autofillClient()) | 886 if (webframe->autofillClient()) |
| 869 webframe->autofillClient()->openTextDataListChooser(WebInputElement(&inp
ut)); | 887 webframe->autofillClient()->openTextDataListChooser(WebInputElement(&inp
ut)); |
| 870 } | 888 } |
| 871 | 889 |
| 872 } // namespace blink | 890 } // namespace blink |
| OLD | NEW |