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

Side by Side Diff: Source/core/page/ChromeClient.cpp

Issue 1167653007: Cleanup: Rename ChromeClient::setWindowRect and setWindowRectInternal. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/ChromeClient.h ('k') | Source/core/page/CreateWindow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 25 matching lines...) Expand all
36 #include "platform/FileChooser.h" 36 #include "platform/FileChooser.h"
37 #include "platform/geometry/IntRect.h" 37 #include "platform/geometry/IntRect.h"
38 #include "platform/network/NetworkHints.h" 38 #include "platform/network/NetworkHints.h"
39 #include "public/platform/WebScreenInfo.h" 39 #include "public/platform/WebScreenInfo.h"
40 #include "wtf/PassRefPtr.h" 40 #include "wtf/PassRefPtr.h"
41 #include "wtf/Vector.h" 41 #include "wtf/Vector.h"
42 #include <algorithm> 42 #include <algorithm>
43 43
44 namespace blink { 44 namespace blink {
45 45
46 void ChromeClient::setWindowRect(const IntRect& pendingRect) 46 void ChromeClient::setWindowRectWithAdjustment(const IntRect& pendingRect)
47 { 47 {
48 IntRect screen = screenInfo().availableRect; 48 IntRect screen = screenInfo().availableRect;
49 IntRect window = pendingRect; 49 IntRect window = pendingRect;
50 50
51 IntSize minimumSize = minimumWindowSize(); 51 IntSize minimumSize = minimumWindowSize();
52 // Let size 0 pass through, since that indicates default size, not minimum s ize. 52 // Let size 0 pass through, since that indicates default size, not minimum s ize.
53 if (window.width()) 53 if (window.width())
54 window.setWidth(std::min(std::max(minimumSize.width(), window.width()), screen.width())); 54 window.setWidth(std::min(std::max(minimumSize.width(), window.width()), screen.width()));
55 if (window.height()) 55 if (window.height())
56 window.setHeight(std::min(std::max(minimumSize.height(), window.height() ), screen.height())); 56 window.setHeight(std::min(std::max(minimumSize.height(), window.height() ), screen.height()));
57 57
58 // Constrain the window position within the valid screen area. 58 // Constrain the window position within the valid screen area.
59 window.setX(std::max(screen.x(), std::min(window.x(), screen.maxX() - window .width()))); 59 window.setX(std::max(screen.x(), std::min(window.x(), screen.maxX() - window .width())));
60 window.setY(std::max(screen.y(), std::min(window.y(), screen.maxY() - window .height()))); 60 window.setY(std::max(screen.y(), std::min(window.y(), screen.maxY() - window .height())));
61 setWindowRectInternal(window); 61 setWindowRect(window);
62 } 62 }
63 63
64 bool ChromeClient::canRunModalIfDuringPageDismissal(Frame* mainFrame, ChromeClie nt::DialogType dialog, const String& message) 64 bool ChromeClient::canRunModalIfDuringPageDismissal(Frame* mainFrame, ChromeClie nt::DialogType dialog, const String& message)
65 { 65 {
66 for (Frame* frame = mainFrame; frame; frame = frame->tree().traverseNext()) { 66 for (Frame* frame = mainFrame; frame; frame = frame->tree().traverseNext()) {
67 if (!frame->isLocalFrame()) 67 if (!frame->isLocalFrame())
68 continue; 68 continue;
69 Document::PageDismissalType dismissal = toLocalFrame(frame)->document()- >pageDismissalEventBeingDispatched(); 69 Document::PageDismissalType dismissal = toLocalFrame(frame)->document()- >pageDismissalEventBeingDispatched();
70 if (dismissal != Document::NoDismissal) 70 if (dismissal != Document::NoDismissal)
71 return shouldRunModalDialogDuringPageDismissal(dialog, message, dism issal); 71 return shouldRunModalDialogDuringPageDismissal(dialog, message, dism issal);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 void ChromeClient::notifyPopupOpeningObservers() const 254 void ChromeClient::notifyPopupOpeningObservers() const
255 { 255 {
256 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); 256 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers);
257 for (size_t i = 0; i < observers.size(); ++i) 257 for (size_t i = 0; i < observers.size(); ++i)
258 observers[i]->willOpenPopup(); 258 observers[i]->willOpenPopup();
259 } 259 }
260 260
261 } // namespace blink 261 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/ChromeClient.h ('k') | Source/core/page/CreateWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698