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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: fix Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "core/HTMLNames.h" 43 #include "core/HTMLNames.h"
44 #include "core/dom/Document.h" 44 #include "core/dom/Document.h"
45 #include "core/dom/Element.h" 45 #include "core/dom/Element.h"
46 #include "core/dom/TaskRunnerHelper.h" 46 #include "core/dom/TaskRunnerHelper.h"
47 #include "core/dom/ViewportDescription.h" 47 #include "core/dom/ViewportDescription.h"
48 #include "core/editing/Editor.h" 48 #include "core/editing/Editor.h"
49 #include "core/events/GestureEvent.h" 49 #include "core/events/GestureEvent.h"
50 #include "core/events/KeyboardEvent.h" 50 #include "core/events/KeyboardEvent.h"
51 #include "core/events/MouseEvent.h" 51 #include "core/events/MouseEvent.h"
52 #include "core/events/PageTransitionEvent.h" 52 #include "core/events/PageTransitionEvent.h"
53 #include "core/frame/ContentSettingsClient.h"
53 #include "core/frame/FrameView.h" 54 #include "core/frame/FrameView.h"
54 #include "core/frame/LocalDOMWindow.h" 55 #include "core/frame/LocalDOMWindow.h"
55 #include "core/frame/LocalFrame.h" 56 #include "core/frame/LocalFrame.h"
56 #include "core/frame/LocalFrameClient.h" 57 #include "core/frame/LocalFrameClient.h"
57 #include "core/frame/Settings.h" 58 #include "core/frame/Settings.h"
58 #include "core/frame/VisualViewport.h" 59 #include "core/frame/VisualViewport.h"
59 #include "core/frame/csp/ContentSecurityPolicy.h" 60 #include "core/frame/csp/ContentSecurityPolicy.h"
60 #include "core/html/HTMLFormElement.h" 61 #include "core/html/HTMLFormElement.h"
61 #include "core/html/HTMLFrameOwnerElement.h" 62 #include "core/html/HTMLFrameOwnerElement.h"
62 #include "core/input/EventHandler.h" 63 #include "core/input/EventHandler.h"
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 670
670 void FrameLoader::setOpener(LocalFrame* opener) { 671 void FrameLoader::setOpener(LocalFrame* opener) {
671 // If the frame is already detached, the opener has already been cleared. 672 // If the frame is already detached, the opener has already been cleared.
672 if (client()) 673 if (client())
673 client()->setOpener(opener); 674 client()->setOpener(opener);
674 } 675 }
675 676
676 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) { 677 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) {
677 // With Oilpan, a FrameLoader might be accessed after the Page has been 678 // With Oilpan, a FrameLoader might be accessed after the Page has been
678 // detached. FrameClient will not be accessible, so bail early. 679 // detached. FrameClient will not be accessible, so bail early.
679 if (!client()) 680 if (!client() || !m_frame->contentSettingsClient())
dcheng 2017/04/02 05:26:19 Similarly, I think we ideally shouldn't need to nu
kinuko 2017/04/03 15:15:06 Done.
680 return false; 681 return false;
681 Settings* settings = m_frame->settings(); 682 Settings* settings = m_frame->settings();
682 bool allowed = 683 bool allowed = m_frame->contentSettingsClient()->allowPlugins(
683 client()->allowPlugins(settings && settings->getPluginsEnabled()); 684 settings && settings->getPluginsEnabled());
684 if (!allowed && reason == AboutToInstantiatePlugin) 685 if (!allowed && reason == AboutToInstantiatePlugin)
685 client()->didNotAllowPlugins(); 686 m_frame->contentSettingsClient()->didNotAllowPlugins();
686 return allowed; 687 return allowed;
687 } 688 }
688 689
689 void FrameLoader::updateForSameDocumentNavigation( 690 void FrameLoader::updateForSameDocumentNavigation(
690 const KURL& newURL, 691 const KURL& newURL,
691 SameDocumentNavigationSource sameDocumentNavigationSource, 692 SameDocumentNavigationSource sameDocumentNavigationSource,
692 PassRefPtr<SerializedScriptValue> data, 693 PassRefPtr<SerializedScriptValue> data,
693 HistoryScrollRestorationType scrollRestorationType, 694 HistoryScrollRestorationType scrollRestorationType,
694 FrameLoadType type, 695 FrameLoadType type,
695 Document* initiatingDocument) { 696 Document* initiatingDocument) {
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 frameLoadRequest.clientRedirect()); 1901 frameLoadRequest.clientRedirect());
1901 1902
1902 loader->setLoadType(loadType); 1903 loader->setLoadType(loadType);
1903 loader->setNavigationType(navigationType); 1904 loader->setNavigationType(navigationType);
1904 loader->setReplacesCurrentHistoryItem(loadType == 1905 loader->setReplacesCurrentHistoryItem(loadType ==
1905 FrameLoadTypeReplaceCurrentItem); 1906 FrameLoadTypeReplaceCurrentItem);
1906 return loader; 1907 return loader;
1907 } 1908 }
1908 1909
1909 } // namespace blink 1910 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698