| OLD | NEW |
| 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
| 38 #include "core/loader/FrameLoader.h" | 38 #include "core/loader/FrameLoader.h" |
| 39 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
| 40 #include "platform/weborigin/SecurityOrigin.h" | 40 #include "platform/weborigin/SecurityOrigin.h" |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 Location::Location(LocalFrame* frame) | 44 Location::Location(LocalFrame* frame) |
| 45 : DOMWindowProperty(frame) | 45 : DOMWindowProperty(frame) |
| 46 { | 46 { |
| 47 ScriptWrappable::init(this); | |
| 48 } | 47 } |
| 49 | 48 |
| 50 inline const KURL& Location::url() const | 49 inline const KURL& Location::url() const |
| 51 { | 50 { |
| 52 ASSERT(m_frame); | 51 ASSERT(m_frame); |
| 53 | 52 |
| 54 const KURL& url = m_frame->document()->url(); | 53 const KURL& url = m_frame->document()->url(); |
| 55 if (!url.isValid()) | 54 if (!url.isValid()) |
| 56 return blankURL(); // Use "about:blank" while the page is still loading
(before we have a frame). | 55 return blankURL(); // Use "about:blank" while the page is still loading
(before we have a frame). |
| 57 | 56 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 void Location::setLocation(const String& url, LocalDOMWindow* callingWindow, Loc
alDOMWindow* enteredWindow) | 244 void Location::setLocation(const String& url, LocalDOMWindow* callingWindow, Loc
alDOMWindow* enteredWindow) |
| 246 { | 245 { |
| 247 ASSERT(m_frame); | 246 ASSERT(m_frame); |
| 248 LocalFrame* frame = m_frame->loader().findFrameForNavigation(nullAtom, calli
ngWindow->document()); | 247 LocalFrame* frame = m_frame->loader().findFrameForNavigation(nullAtom, calli
ngWindow->document()); |
| 249 if (!frame) | 248 if (!frame) |
| 250 return; | 249 return; |
| 251 frame->domWindow()->setLocation(url, callingWindow, enteredWindow); | 250 frame->domWindow()->setLocation(url, callingWindow, enteredWindow); |
| 252 } | 251 } |
| 253 | 252 |
| 254 } // namespace blink | 253 } // namespace blink |
| OLD | NEW |