Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: Source/web/ChromeClientImpl.cpp

Issue 638003004: Introduce WebFrameWidget to Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased, cleaned up some Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/web/WebFrameWidgetImpl.h » ('j') | Source/web/WebFrameWidgetImpl.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
dcheng 2014/12/10 21:00:58 I guess I don't understand--why are we scheduling
kenrb 2014/12/11 20:21:21 It is called during attachment of the Document's r
dcheng 2014/12/11 23:31:45 Is this going to be temporary code? I'm OK with th
kenrb 2014/12/16 18:51:00 The call to ChromeClientImpl::scheduleAnimation()
dcheng 2014/12/16 20:13:06 A WebView is a WebWidget, so you can never have on
498 if (!WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()) {
Nate Chapin 2014/12/10 19:19:03 Style nit: {} not necessary on this if-else
kenrb 2014/12/11 20:21:21 Done.
499 scheduleAnimation();
500 } else {
501 WebLocalFrameImpl::fromFrame(localRoot)->frameWidget()->scheduleAnimatio n();
502 }
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
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 ASSERT(webFrame && webFrame->frameWidget());
ncarter (slow) 2014/12/10 20:16:06 After patching in this change, this ASSERT seems t
kenrb 2014/12/11 20:21:21 This is an artifact of me not testing without the
711 webFrame->frameWidget()->setRootGraphicsLayer(rootLayer);
712 }
700 } 713 }
701 714
702 void ChromeClientImpl::enterFullScreenForElement(Element* element) 715 void ChromeClientImpl::enterFullScreenForElement(Element* element)
703 { 716 {
704 m_webView->enterFullScreenForElement(element); 717 m_webView->enterFullScreenForElement(element);
705 } 718 }
706 719
707 void ChromeClientImpl::exitFullScreenForElement(Element* element) 720 void ChromeClientImpl::exitFullScreenForElement(Element* element)
708 { 721 {
709 m_webView->exitFullScreenForElement(element); 722 m_webView->exitFullScreenForElement(element);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 { 876 {
864 // FIXME: remove. See http://crbug.com/425756 877 // FIXME: remove. See http://crbug.com/425756
865 if (m_webView->autofillClient()) 878 if (m_webView->autofillClient())
866 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put)); 879 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put));
867 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document(). frame()); 880 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document(). frame());
868 if (webframe->autofillClient()) 881 if (webframe->autofillClient())
869 webframe->autofillClient()->openTextDataListChooser(WebInputElement(&inp ut)); 882 webframe->autofillClient()->openTextDataListChooser(WebInputElement(&inp ut));
870 } 883 }
871 884
872 } // namespace blink 885 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/WebFrameWidgetImpl.h » ('j') | Source/web/WebFrameWidgetImpl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698