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

Side by Side Diff: third_party/WebKit/Source/core/page/ChromeClient.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, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2012, Samsung Electronics. All rights reserved. 4 * Copyright (C) 2012, Samsung Electronics. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 18 matching lines...) Expand all
29 #include "core/page/FrameTree.h" 29 #include "core/page/FrameTree.h"
30 #include "core/page/ScopedPageLoadDeferrer.h" 30 #include "core/page/ScopedPageLoadDeferrer.h"
31 #include "core/page/WindowFeatures.h" 31 #include "core/page/WindowFeatures.h"
32 #include "platform/geometry/IntRect.h" 32 #include "platform/geometry/IntRect.h"
33 #include "platform/network/NetworkHints.h" 33 #include "platform/network/NetworkHints.h"
34 #include "public/platform/WebScreenInfo.h" 34 #include "public/platform/WebScreenInfo.h"
35 #include <algorithm> 35 #include <algorithm>
36 36
37 namespace blink { 37 namespace blink {
38 38
39 void ChromeClient::setWindowRectWithAdjustment(const IntRect& pendingRect) 39 void ChromeClient::setWindowRectWithAdjustment(const IntRect& pendingRect, Local Frame& frame)
40 { 40 {
41 IntRect screen = screenInfo().availableRect; 41 IntRect screen = screenInfo().availableRect;
42 IntRect window = pendingRect; 42 IntRect window = pendingRect;
43 43
44 IntSize minimumSize = minimumWindowSize(); 44 IntSize minimumSize = minimumWindowSize();
45 // Let size 0 pass through, since that indicates default size, not minimum 45 // Let size 0 pass through, since that indicates default size, not minimum
46 // size. 46 // size.
47 if (window.width()) 47 if (window.width())
48 window.setWidth(std::min(std::max(minimumSize.width(), window.width()), screen.width())); 48 window.setWidth(std::min(std::max(minimumSize.width(), window.width()), screen.width()));
49 if (window.height()) 49 if (window.height())
50 window.setHeight(std::min(std::max(minimumSize.height(), window.height() ), screen.height())); 50 window.setHeight(std::min(std::max(minimumSize.height(), window.height() ), screen.height()));
51 51
52 // Constrain the window position within the valid screen area. 52 // Constrain the window position within the valid screen area.
53 window.setX(std::max(screen.x(), std::min(window.x(), screen.maxX() - window .width()))); 53 window.setX(std::max(screen.x(), std::min(window.x(), screen.maxX() - window .width())));
54 window.setY(std::max(screen.y(), std::min(window.y(), screen.maxY() - window .height()))); 54 window.setY(std::max(screen.y(), std::min(window.y(), screen.maxY() - window .height())));
55 setWindowRect(window); 55 setWindowRect(window, frame);
56 } 56 }
57 57
58 bool ChromeClient::canOpenModalIfDuringPageDismissal(Frame* mainFrame, ChromeCli ent::DialogType dialog, const String& message) 58 bool ChromeClient::canOpenModalIfDuringPageDismissal(Frame* mainFrame, ChromeCli ent::DialogType dialog, const String& message)
59 { 59 {
60 for (Frame* frame = mainFrame; frame; frame = frame->tree().traverseNext()) { 60 for (Frame* frame = mainFrame; frame; frame = frame->tree().traverseNext()) {
61 if (!frame->isLocalFrame()) 61 if (!frame->isLocalFrame())
62 continue; 62 continue;
63 Document::PageDismissalType dismissal = toLocalFrame(frame)->document()- >pageDismissalEventBeingDispatched(); 63 Document::PageDismissalType dismissal = toLocalFrame(frame)->document()- >pageDismissalEventBeingDispatched();
64 if (dismissal != Document::NoDismissal) 64 if (dismissal != Document::NoDismissal)
65 return shouldOpenModalDialogDuringPageDismissal(dialog, message, dis missal); 65 return shouldOpenModalDialogDuringPageDismissal(dialog, message, dis missal);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 { 178 {
179 // Defer loads in case the client method runs a new event loop that would 179 // Defer loads in case the client method runs a new event loop that would
180 // otherwise cause the load to continue while we're in the middle of 180 // otherwise cause the load to continue while we're in the middle of
181 // executing JavaScript. 181 // executing JavaScript.
182 ScopedPageLoadDeferrer deferrer; 182 ScopedPageLoadDeferrer deferrer;
183 183
184 printDelegate(frame); 184 printDelegate(frame);
185 } 185 }
186 186
187 } // namespace blink 187 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.h ('k') | third_party/WebKit/Source/core/page/CreateWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698