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

Side by Side Diff: Source/core/frame/Location.cpp

Issue 799923006: Make canNavigate() OOPI-friendly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check in History.cpp Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/frame/RemoteFrame.h » ('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) 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 if (!m_frame) 241 if (!m_frame)
242 return; 242 return;
243 if (protocolIsJavaScript(m_frame->document()->url())) 243 if (protocolIsJavaScript(m_frame->document()->url()))
244 return; 244 return;
245 m_frame->reload(NormalReload, ClientRedirect); 245 m_frame->reload(NormalReload, ClientRedirect);
246 } 246 }
247 247
248 void Location::setLocation(const String& url, LocalDOMWindow* callingWindow, Loc alDOMWindow* enteredWindow) 248 void Location::setLocation(const String& url, LocalDOMWindow* callingWindow, Loc alDOMWindow* enteredWindow)
249 { 249 {
250 ASSERT(m_frame); 250 ASSERT(m_frame);
251 LocalFrame* frame = m_frame->loader().findFrameForNavigation(nullAtom, calli ngWindow->document()); 251 Frame* frame = m_frame->findFrameForNavigation(nullAtom, *callingWindow->fra me());
252 if (!frame) 252 if (!frame || !frame->isLocalFrame())
253 return; 253 return;
254 // FIXME: setLocation() probably belongs on DOMWindow, since you can trigger 254 // FIXME: setLocation() probably belongs on DOMWindow, since you can trigger
255 // navigations across different origins. 255 // navigations across different origins.
256 frame->localDOMWindow()->setLocation(url, callingWindow, enteredWindow); 256 toLocalFrame(frame)->localDOMWindow()->setLocation(url, callingWindow, enter edWindow);
257 } 257 }
258 258
259 } // namespace blink 259 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/frame/RemoteFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698