| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "platform/weborigin/SecurityOrigin.h" | 43 #include "platform/weborigin/SecurityOrigin.h" |
| 44 #include "platform/weborigin/SecurityPolicy.h" | 44 #include "platform/weborigin/SecurityPolicy.h" |
| 45 #include "public/platform/WebURLRequest.h" | 45 #include "public/platform/WebURLRequest.h" |
| 46 | 46 |
| 47 namespace blink { | 47 namespace blink { |
| 48 | 48 |
| 49 static Frame* reuseExistingWindow(LocalFrame& activeFrame, | 49 static Frame* reuseExistingWindow(LocalFrame& activeFrame, |
| 50 LocalFrame& lookupFrame, | 50 LocalFrame& lookupFrame, |
| 51 const AtomicString& frameName, | 51 const AtomicString& frameName, |
| 52 NavigationPolicy policy) { | 52 NavigationPolicy policy) { |
| 53 if (!frameName.isEmpty() && frameName != "_blank" && | 53 if (!frameName.isEmpty() && !equalIgnoringASCIICase(frameName, "_blank") && |
| 54 policy == NavigationPolicyIgnore) { | 54 policy == NavigationPolicyIgnore) { |
| 55 if (Frame* frame = | 55 if (Frame* frame = |
| 56 lookupFrame.findFrameForNavigation(frameName, activeFrame)) { | 56 lookupFrame.findFrameForNavigation(frameName, activeFrame)) { |
| 57 if (frameName != "_self") { | 57 if (!equalIgnoringASCIICase(frameName, "_self")) { |
| 58 if (Page* page = frame->page()) { | 58 if (Page* page = frame->page()) { |
| 59 if (page == activeFrame.page()) | 59 if (page == activeFrame.page()) |
| 60 page->focusController().setFocusedFrame(frame); | 60 page->focusController().setFocusedFrame(frame); |
| 61 else | 61 else |
| 62 page->chromeClient().focus(); | 62 page->chromeClient().focus(); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 return frame; | 65 return frame; |
| 66 } | 66 } |
| 67 } | 67 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 78 return nullptr; | 78 return nullptr; |
| 79 | 79 |
| 80 Page* page = oldPage->chromeClient().createWindow(&openerFrame, request, | 80 Page* page = oldPage->chromeClient().createWindow(&openerFrame, request, |
| 81 features, policy); | 81 features, policy); |
| 82 if (!page) | 82 if (!page) |
| 83 return nullptr; | 83 return nullptr; |
| 84 | 84 |
| 85 ASSERT(page->mainFrame()); | 85 ASSERT(page->mainFrame()); |
| 86 LocalFrame& frame = *toLocalFrame(page->mainFrame()); | 86 LocalFrame& frame = *toLocalFrame(page->mainFrame()); |
| 87 | 87 |
| 88 if (request.frameName() != "_blank") | 88 if (!equalIgnoringASCIICase(request.frameName(), "_blank")) |
| 89 frame.tree().setName(request.frameName()); | 89 frame.tree().setName(request.frameName()); |
| 90 | 90 |
| 91 page->chromeClient().setWindowFeatures(features); | 91 page->chromeClient().setWindowFeatures(features); |
| 92 | 92 |
| 93 // 'x' and 'y' specify the location of the window, while 'width' and 'height' | 93 // 'x' and 'y' specify the location of the window, while 'width' and 'height' |
| 94 // specify the size of the viewport. We can only resize the window, so adjust | 94 // specify the size of the viewport. We can only resize the window, so adjust |
| 95 // for the difference between the window size and the viewport size. | 95 // for the difference between the window size and the viewport size. |
| 96 | 96 |
| 97 IntRect windowRect = page->chromeClient().rootWindowRect(); | 97 IntRect windowRect = page->chromeClient().rootWindowRect(); |
| 98 IntSize viewportSize = page->chromeClient().pageRect().size(); | 98 IntSize viewportSize = page->chromeClient().pageRect().size(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 287 } |
| 288 | 288 |
| 289 // TODO(japhet): Form submissions on RemoteFrames don't work yet. | 289 // TODO(japhet): Form submissions on RemoteFrames don't work yet. |
| 290 FrameLoadRequest newRequest(0, request.resourceRequest()); | 290 FrameLoadRequest newRequest(0, request.resourceRequest()); |
| 291 newRequest.setForm(request.form()); | 291 newRequest.setForm(request.form()); |
| 292 if (newFrame->isLocalFrame()) | 292 if (newFrame->isLocalFrame()) |
| 293 toLocalFrame(newFrame)->loader().load(newRequest); | 293 toLocalFrame(newFrame)->loader().load(newRequest); |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace blink | 296 } // namespace blink |
| OLD | NEW |