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

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

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: whee Created 6 years, 1 month 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
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 if (!m_frame) 227 if (!m_frame)
228 return; 228 return;
229 setLocation(url, callingWindow, enteredWindow); 229 setLocation(url, callingWindow, enteredWindow);
230 } 230 }
231 231
232 void Location::replace(LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWin dow, const String& url) 232 void Location::replace(LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWin dow, const String& url)
233 { 233 {
234 if (!m_frame) 234 if (!m_frame)
235 return; 235 return;
236 // Note: We call LocalDOMWindow::setLocation directly here because replace() always operates on the current frame. 236 // Note: We call LocalDOMWindow::setLocation directly here because replace() always operates on the current frame.
237 m_frame->domWindow()->setLocation(url, callingWindow, enteredWindow, LockHis toryAndBackForwardList); 237 // FIXME: setLocation() probably belongs on DOMWindow, since you can trigger
238 // navigations across different origins.
239 m_frame->localDOMWindow()->setLocation(url, callingWindow, enteredWindow, Lo ckHistoryAndBackForwardList);
238 } 240 }
239 241
240 void Location::reload(LocalDOMWindow* callingWindow) 242 void Location::reload(LocalDOMWindow* callingWindow)
241 { 243 {
242 if (!m_frame) 244 if (!m_frame)
243 return; 245 return;
244 if (protocolIsJavaScript(m_frame->document()->url())) 246 if (protocolIsJavaScript(m_frame->document()->url()))
245 return; 247 return;
246 m_frame->navigationScheduler().scheduleReload(); 248 m_frame->navigationScheduler().scheduleReload();
247 } 249 }
248 250
249 void Location::setLocation(const String& url, LocalDOMWindow* callingWindow, Loc alDOMWindow* enteredWindow) 251 void Location::setLocation(const String& url, LocalDOMWindow* callingWindow, Loc alDOMWindow* enteredWindow)
250 { 252 {
251 ASSERT(m_frame); 253 ASSERT(m_frame);
254 // FIXME: This is probably wrong.
dcheng 2014/10/31 03:20:41 I'm going to remove this FIXME in my next patchset
252 LocalFrame* frame = m_frame->loader().findFrameForNavigation(nullAtom, calli ngWindow->document()); 255 LocalFrame* frame = m_frame->loader().findFrameForNavigation(nullAtom, calli ngWindow->document());
253 if (!frame) 256 if (!frame)
254 return; 257 return;
255 frame->domWindow()->setLocation(url, callingWindow, enteredWindow); 258 // FIXME: setLocation() probably belongs on DOMWindow, since you can trigger
259 // navigations across different origins.
260 frame->localDOMWindow()->setLocation(url, callingWindow, enteredWindow);
256 } 261 }
257 262
258 } // namespace blink 263 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698