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

Side by Side Diff: third_party/WebKit/Source/core/page/CreateWindow.cpp

Issue 2177333002: Move setWindowRect and windowRect calls from WebViewClient to WebWidgetClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch to refs Created 4 years, 4 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
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 if (request.frameName() != "_blank") 82 if (request.frameName() != "_blank")
83 frame.tree().setName(request.frameName()); 83 frame.tree().setName(request.frameName());
84 84
85 host->chromeClient().setWindowFeatures(features); 85 host->chromeClient().setWindowFeatures(features);
86 86
87 // 'x' and 'y' specify the location of the window, while 'width' and 'height ' 87 // 'x' and 'y' specify the location of the window, while 'width' and 'height '
88 // specify the size of the viewport. We can only resize the window, so adjus t 88 // specify the size of the viewport. We can only resize the window, so adjus t
89 // for the difference between the window size and the viewport size. 89 // for the difference between the window size and the viewport size.
90 90
91 IntRect windowRect = host->chromeClient().windowRect(); 91 IntRect windowRect = host->chromeClient().rootWindowRect();
92 IntSize viewportSize = host->chromeClient().pageRect().size(); 92 IntSize viewportSize = host->chromeClient().pageRect().size();
93 93
94 if (features.xSet) 94 if (features.xSet)
95 windowRect.setX(features.x); 95 windowRect.setX(features.x);
96 if (features.ySet) 96 if (features.ySet)
97 windowRect.setY(features.y); 97 windowRect.setY(features.y);
98 if (features.widthSet) 98 if (features.widthSet)
99 windowRect.setWidth(features.width + (windowRect.width() - viewportSize. width())); 99 windowRect.setWidth(features.width + (windowRect.width() - viewportSize. width()));
100 if (features.heightSet) 100 if (features.heightSet)
101 windowRect.setHeight(features.height + (windowRect.height() - viewportSi ze.height())); 101 windowRect.setHeight(features.height + (windowRect.height() - viewportSi ze.height()));
102 102
103 host->chromeClient().setWindowRectWithAdjustment(windowRect); 103 host->chromeClient().setWindowRectWithAdjustment(windowRect, frame);
104 host->chromeClient().show(policy); 104 host->chromeClient().show(policy);
105 105
106 if (openerFrame.document()->isSandboxed(SandboxPropagatesToAuxiliaryBrowsing Contexts)) 106 if (openerFrame.document()->isSandboxed(SandboxPropagatesToAuxiliaryBrowsing Contexts))
107 frame.loader().forceSandboxFlags(openerFrame.securityContext()->getSandb oxFlags()); 107 frame.loader().forceSandboxFlags(openerFrame.securityContext()->getSandb oxFlags());
108 108
109 // This call may suspend the execution by running nested message loop. 109 // This call may suspend the execution by running nested message loop.
110 InspectorInstrumentation::windowCreated(&openerFrame, &frame); 110 InspectorInstrumentation::windowCreated(&openerFrame, &frame);
111 created = true; 111 created = true;
112 return &frame; 112 return &frame;
113 } 113 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 228
229 // TODO(japhet): Form submissions on RemoteFrames don't work yet. 229 // TODO(japhet): Form submissions on RemoteFrames don't work yet.
230 FrameLoadRequest newRequest(0, request.resourceRequest()); 230 FrameLoadRequest newRequest(0, request.resourceRequest());
231 newRequest.setForm(request.form()); 231 newRequest.setForm(request.form());
232 if (newFrame->isLocalFrame()) 232 if (newFrame->isLocalFrame())
233 toLocalFrame(newFrame)->loader().load(newRequest); 233 toLocalFrame(newFrame)->loader().load(newRequest);
234 } 234 }
235 235
236 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.cpp ('k') | third_party/WebKit/Source/web/ChromeClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698