| 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 // FIXME: Is this the right thing to do? Is there a way to avoid having |
| 499 // a local frame root that doesn't have a WebWidget? During initialization |
| 500 // there is no content to draw so this call serves no purpose. |
| 501 if (WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()) |
| 502 WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()->scheduleAnimatio
n(); |
| 497 } | 503 } |
| 498 | 504 |
| 499 IntRect ChromeClientImpl::rootViewToScreen(const IntRect& rect) const | 505 IntRect ChromeClientImpl::rootViewToScreen(const IntRect& rect) const |
| 500 { | 506 { |
| 501 IntRect screenRect(rect); | 507 IntRect screenRect(rect); |
| 502 | 508 |
| 503 if (m_webView->client()) { | 509 if (m_webView->client()) { |
| 504 WebRect windowRect = m_webView->client()->windowRect(); | 510 WebRect windowRect = m_webView->client()->windowRect(); |
| 505 screenRect.move(windowRect.x, windowRect.y); | 511 screenRect.move(windowRect.x, windowRect.y); |
| 506 } | 512 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 return false; | 694 return false; |
| 689 } | 695 } |
| 690 | 696 |
| 691 GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const | 697 GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const |
| 692 { | 698 { |
| 693 return m_webView->graphicsLayerFactory(); | 699 return m_webView->graphicsLayerFactory(); |
| 694 } | 700 } |
| 695 | 701 |
| 696 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
ame* localRoot) | 702 void ChromeClientImpl::attachRootGraphicsLayer(GraphicsLayer* rootLayer, LocalFr
ame* localRoot) |
| 697 { | 703 { |
| 698 // FIXME: Add call to frame's widget for non-zero frames. | 704 // FIXME: For top-level frames we still use the WebView as a WebWidget. This
special |
| 699 m_webView->setRootGraphicsLayer(rootLayer); | 705 // case will be removed when top-level frames get WebFrameWidgets. |
| 706 if (localRoot->isMainFrame()) { |
| 707 m_webView->setRootGraphicsLayer(rootLayer); |
| 708 } else { |
| 709 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); |
| 710 // FIXME: The following conditional is only needed for staging until the
Chromium patch |
| 711 // lands that instantiates a WebFrameWidget. |
| 712 if (!webFrame->frameWidget()) { |
| 713 m_webView->setRootGraphicsLayer(rootLayer); |
| 714 return; |
| 715 } |
| 716 ASSERT(webFrame && webFrame->frameWidget()); |
| 717 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer); |
| 718 } |
| 700 } | 719 } |
| 701 | 720 |
| 702 void ChromeClientImpl::enterFullScreenForElement(Element* element) | 721 void ChromeClientImpl::enterFullScreenForElement(Element* element) |
| 703 { | 722 { |
| 704 m_webView->enterFullScreenForElement(element); | 723 m_webView->enterFullScreenForElement(element); |
| 705 } | 724 } |
| 706 | 725 |
| 707 void ChromeClientImpl::exitFullScreenForElement(Element* element) | 726 void ChromeClientImpl::exitFullScreenForElement(Element* element) |
| 708 { | 727 { |
| 709 m_webView->exitFullScreenForElement(element); | 728 m_webView->exitFullScreenForElement(element); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 { | 897 { |
| 879 // FIXME: remove. See http://crbug.com/425756 | 898 // FIXME: remove. See http://crbug.com/425756 |
| 880 if (m_webView->autofillClient()) | 899 if (m_webView->autofillClient()) |
| 881 m_webView->autofillClient()->dataListOptionsChanged(WebInputElement(&inp
ut)); | 900 m_webView->autofillClient()->dataListOptionsChanged(WebInputElement(&inp
ut)); |
| 882 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document().
frame()); | 901 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document().
frame()); |
| 883 if (webframe->autofillClient()) | 902 if (webframe->autofillClient()) |
| 884 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu
t)); | 903 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu
t)); |
| 885 } | 904 } |
| 886 | 905 |
| 887 } // namespace blink | 906 } // namespace blink |
| OLD | NEW |