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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2617773002: Turn off requirement that cross-origin top navigation be accompanied by a user gesture. (Closed)
Patch Set: Created 3 years, 11 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "core/frame/FrameConsole.h" 48 #include "core/frame/FrameConsole.h"
49 #include "core/frame/FrameHost.h" 49 #include "core/frame/FrameHost.h"
50 #include "core/frame/FrameView.h" 50 #include "core/frame/FrameView.h"
51 #include "core/frame/LocalDOMWindow.h" 51 #include "core/frame/LocalDOMWindow.h"
52 #include "core/frame/PerformanceMonitor.h" 52 #include "core/frame/PerformanceMonitor.h"
53 #include "core/frame/Settings.h" 53 #include "core/frame/Settings.h"
54 #include "core/frame/VisualViewport.h" 54 #include "core/frame/VisualViewport.h"
55 #include "core/html/HTMLFrameElementBase.h" 55 #include "core/html/HTMLFrameElementBase.h"
56 #include "core/html/HTMLPlugInElement.h" 56 #include "core/html/HTMLPlugInElement.h"
57 #include "core/input/EventHandler.h" 57 #include "core/input/EventHandler.h"
58 #include "core/inspector/ConsoleMessage.h"
58 #include "core/inspector/InspectorInstrumentation.h" 59 #include "core/inspector/InspectorInstrumentation.h"
59 #include "core/layout/HitTestResult.h" 60 #include "core/layout/HitTestResult.h"
60 #include "core/layout/LayoutView.h" 61 #include "core/layout/LayoutView.h"
61 #include "core/layout/api/LayoutPartItem.h" 62 #include "core/layout/api/LayoutPartItem.h"
62 #include "core/layout/api/LayoutViewItem.h" 63 #include "core/layout/api/LayoutViewItem.h"
63 #include "core/layout/compositing/PaintLayerCompositor.h" 64 #include "core/layout/compositing/PaintLayerCompositor.h"
64 #include "core/loader/FrameLoadRequest.h" 65 #include "core/loader/FrameLoadRequest.h"
65 #include "core/loader/FrameLoaderClient.h" 66 #include "core/loader/FrameLoaderClient.h"
66 #include "core/loader/NavigationScheduler.h" 67 #include "core/loader/NavigationScheduler.h"
67 #include "core/page/ChromeClient.h" 68 #include "core/page/ChromeClient.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 targetFrame.securityContext()->getSecurityOrigin()->toString() + 472 targetFrame.securityContext()->getSecurityOrigin()->toString() +
472 "'"; 473 "'";
473 String message = 474 String message =
474 "Unsafe JavaScript attempt to initiate navigation for frame " + 475 "Unsafe JavaScript attempt to initiate navigation for frame " +
475 targetFrameDescription + " from frame with URL '" + 476 targetFrameDescription + " from frame with URL '" +
476 document()->url().getString() + "'. " + reason + "\n"; 477 document()->url().getString() + "'. " + reason + "\n";
477 478
478 domWindow()->printErrorMessage(message); 479 domWindow()->printErrorMessage(message);
479 } 480 }
480 481
482 void LocalFrame::printNavigationWarning(const String& message) {
483 m_console->addMessage(
484 ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message));
485 }
486
481 WindowProxyManager* LocalFrame::getWindowProxyManager() const { 487 WindowProxyManager* LocalFrame::getWindowProxyManager() const {
482 return m_script->getWindowProxyManager(); 488 return m_script->getWindowProxyManager();
483 } 489 }
484 490
485 bool LocalFrame::shouldClose() { 491 bool LocalFrame::shouldClose() {
486 // TODO(dcheng): This should be fixed to dispatch beforeunload events to 492 // TODO(dcheng): This should be fixed to dispatch beforeunload events to
487 // both local and remote frames. 493 // both local and remote frames.
488 return m_loader.shouldClose(); 494 return m_loader.shouldClose();
489 } 495 }
490 496
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 933 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
928 m_frame->client()->frameBlameContext()->Enter(); 934 m_frame->client()->frameBlameContext()->Enter();
929 } 935 }
930 936
931 ScopedFrameBlamer::~ScopedFrameBlamer() { 937 ScopedFrameBlamer::~ScopedFrameBlamer() {
932 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 938 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
933 m_frame->client()->frameBlameContext()->Leave(); 939 m_frame->client()->frameBlameContext()->Leave();
934 } 940 }
935 941
936 } // namespace blink 942 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698