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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 if (!m_frame) | 113 if (!m_frame) |
114 return String(); | 114 return String(); |
115 return DOMURLUtilsReadOnly::origin(url()); | 115 return DOMURLUtilsReadOnly::origin(url()); |
116 } | 116 } |
117 | 117 |
118 PassRefPtrWillBeRawPtr<DOMStringList> Location::ancestorOrigins() const | 118 PassRefPtrWillBeRawPtr<DOMStringList> Location::ancestorOrigins() const |
119 { | 119 { |
120 RefPtrWillBeRawPtr<DOMStringList> origins = DOMStringList::create(); | 120 RefPtrWillBeRawPtr<DOMStringList> origins = DOMStringList::create(); |
121 if (!m_frame) | 121 if (!m_frame) |
122 return origins.release(); | 122 return origins.release(); |
123 for (LocalFrame* frame = m_frame->tree().parent(); frame; frame = frame->tre
e().parent()) | 123 // FIXME: We do not yet have access to remote frame's origin. |
124 origins->append(frame->document()->securityOrigin()->toString()); | 124 for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().p
arent()) { |
| 125 if (frame->isLocalFrame()) |
| 126 origins->append(toLocalFrame(frame)->document()->securityOrigin()->t
oString()); |
| 127 } |
125 return origins.release(); | 128 return origins.release(); |
126 } | 129 } |
127 | 130 |
128 String Location::hash() const | 131 String Location::hash() const |
129 { | 132 { |
130 if (!m_frame) | 133 if (!m_frame) |
131 return String(); | 134 return String(); |
132 | 135 |
133 return DOMURLUtilsReadOnly::hash(url()); | 136 return DOMURLUtilsReadOnly::hash(url()); |
134 } | 137 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 void Location::setLocation(const String& url, DOMWindow* callingWindow, DOMWindo
w* enteredWindow) | 245 void Location::setLocation(const String& url, DOMWindow* callingWindow, DOMWindo
w* enteredWindow) |
243 { | 246 { |
244 ASSERT(m_frame); | 247 ASSERT(m_frame); |
245 LocalFrame* frame = m_frame->loader().findFrameForNavigation(nullAtom, calli
ngWindow->document()); | 248 LocalFrame* frame = m_frame->loader().findFrameForNavigation(nullAtom, calli
ngWindow->document()); |
246 if (!frame) | 249 if (!frame) |
247 return; | 250 return; |
248 frame->domWindow()->setLocation(url, callingWindow, enteredWindow); | 251 frame->domWindow()->setLocation(url, callingWindow, enteredWindow); |
249 } | 252 } |
250 | 253 |
251 } // namespace WebCore | 254 } // namespace WebCore |
OLD | NEW |