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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 13851023: Remove ChromeClient cruft (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 7 months 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 | « Source/WebKit/chromium/src/WebPopupMenuImpl.cpp ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 4706 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 // An algorithm is allowed to show a pop-up if, in the task in which t he algorithm is running, either: 4717 // An algorithm is allowed to show a pop-up if, in the task in which t he algorithm is running, either:
4718 // - an activation behavior is currently being processed whose click e vent was trusted, or 4718 // - an activation behavior is currently being processed whose click e vent was trusted, or
4719 // - the event listener for a trusted click event is being handled. 4719 // - the event listener for a trusted click event is being handled.
4720 if (!ScriptController::processingUserGesture()) 4720 if (!ScriptController::processingUserGesture())
4721 break; 4721 break;
4722 4722
4723 // There is a previously-established user preference, security risk, or platform limitation. 4723 // There is a previously-established user preference, security risk, or platform limitation.
4724 if (!page() || !page()->settings()->fullScreenEnabled()) 4724 if (!page() || !page()->settings()->fullScreenEnabled())
4725 break; 4725 break;
4726 4726
4727 if (!page()->chrome()->client()->supportsFullScreenForElement(element, f lags & Element::ALLOW_KEYBOARD_INPUT)) {
4728 // The new full screen API does not accept a "flags" parameter, so f all back to disallowing
4729 // keyboard input if the chrome client refuses to allow keyboard inp ut.
4730 if (!inLegacyMozillaMode && flags & Element::ALLOW_KEYBOARD_INPUT) {
4731 flags &= ~Element::ALLOW_KEYBOARD_INPUT;
4732 if (!page()->chrome()->client()->supportsFullScreenForElement(el ement, false))
4733 break;
4734 } else
4735 break;
4736 }
4737
4738 // 2. Let doc be element's node document. (i.e. "this") 4727 // 2. Let doc be element's node document. (i.e. "this")
4739 Document* currentDoc = this; 4728 Document* currentDoc = this;
4740 4729
4741 // 3. Let docs be all doc's ancestor browsing context's documents (if an y) and doc. 4730 // 3. Let docs be all doc's ancestor browsing context's documents (if an y) and doc.
4742 Deque<Document*> docs; 4731 Deque<Document*> docs;
4743 4732
4744 do { 4733 do {
4745 docs.prepend(currentDoc); 4734 docs.prepend(currentDoc);
4746 currentDoc = currentDoc->ownerElement() ? currentDoc->ownerElement() ->document() : 0; 4735 currentDoc = currentDoc->ownerElement() ? currentDoc->ownerElement() ->document() : 0;
4747 } while (currentDoc); 4736 } while (currentDoc);
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
4995 else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placehold er()) { 4984 else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placehold er()) {
4996 RenderBlock* placeholder = m_fullScreenRenderer->placeholder(); 4985 RenderBlock* placeholder = m_fullScreenRenderer->placeholder();
4997 renderer->createPlaceholder(RenderStyle::clone(placeholder->style()), pl aceholder->frameRect()); 4986 renderer->createPlaceholder(RenderStyle::clone(placeholder->style()), pl aceholder->frameRect());
4998 } 4987 }
4999 4988
5000 if (m_fullScreenRenderer) 4989 if (m_fullScreenRenderer)
5001 m_fullScreenRenderer->destroy(); 4990 m_fullScreenRenderer->destroy();
5002 ASSERT(!m_fullScreenRenderer); 4991 ASSERT(!m_fullScreenRenderer);
5003 4992
5004 m_fullScreenRenderer = renderer; 4993 m_fullScreenRenderer = renderer;
5005
5006 // This notification can come in after the page has been destroyed.
5007 if (page())
5008 page()->chrome()->client()->fullScreenRendererChanged(m_fullScreenRender er);
5009 } 4994 }
5010 4995
5011 void Document::fullScreenRendererDestroyed() 4996 void Document::fullScreenRendererDestroyed()
5012 { 4997 {
5013 m_fullScreenRenderer = 0; 4998 m_fullScreenRenderer = 0;
5014
5015 if (page())
5016 page()->chrome()->client()->fullScreenRendererChanged(0);
5017 } 4999 }
5018 5000
5019 void Document::setFullScreenRendererSize(const IntSize& size) 5001 void Document::setFullScreenRendererSize(const IntSize& size)
5020 { 5002 {
5021 ASSERT(m_fullScreenRenderer); 5003 ASSERT(m_fullScreenRenderer);
5022 if (!m_fullScreenRenderer) 5004 if (!m_fullScreenRenderer)
5023 return; 5005 return;
5024 5006
5025 if (m_fullScreenRenderer) { 5007 if (m_fullScreenRenderer) {
5026 RefPtr<RenderStyle> newStyle = RenderStyle::clone(m_fullScreenRenderer-> style()); 5008 RefPtr<RenderStyle> newStyle = RenderStyle::clone(m_fullScreenRenderer-> style());
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
5692 5674
5693 PassRefPtr<FontLoader> Document::fontloader() 5675 PassRefPtr<FontLoader> Document::fontloader()
5694 { 5676 {
5695 if (!m_fontloader) 5677 if (!m_fontloader)
5696 m_fontloader = FontLoader::create(this); 5678 m_fontloader = FontLoader::create(this);
5697 return m_fontloader; 5679 return m_fontloader;
5698 } 5680 }
5699 5681
5700 void Document::didAssociateFormControl(Element* element) 5682 void Document::didAssociateFormControl(Element* element)
5701 { 5683 {
5702 if (!frame() || !frame()->page() || !frame()->page()->chrome()->client()->sh ouldNotifyOnFormChanges()) 5684 if (!frame() || !frame()->page())
5703 return; 5685 return;
5704 m_associatedFormControls.add(element); 5686 m_associatedFormControls.add(element);
5705 if (!m_didAssociateFormControlsTimer.isActive()) 5687 if (!m_didAssociateFormControlsTimer.isActive())
5706 m_didAssociateFormControlsTimer.startOneShot(0); 5688 m_didAssociateFormControlsTimer.startOneShot(0);
5707 } 5689 }
5708 5690
5709 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) 5691 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer)
5710 { 5692 {
5711 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer); 5693 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer);
5712 if (!frame() || !frame()->page()) 5694 if (!frame() || !frame()->page())
5713 return; 5695 return;
5714 5696
5715 Vector<RefPtr<Element> > associatedFormControls; 5697 Vector<RefPtr<Element> > associatedFormControls;
5716 copyToVector(m_associatedFormControls, associatedFormControls); 5698 copyToVector(m_associatedFormControls, associatedFormControls);
5717 5699
5718 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm Controls); 5700 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm Controls);
5719 m_associatedFormControls.clear(); 5701 m_associatedFormControls.clear();
5720 } 5702 }
5721 5703
5722 } // namespace WebCore 5704 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebPopupMenuImpl.cpp ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698