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

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

Issue 174073007: Remove deprecated window.showModalDialog() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/Chrome.h ('k') | Source/core/page/ChromeClient.h » ('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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void Chrome::focusedNodeChanged(Node* node) const 128 void Chrome::focusedNodeChanged(Node* node) const
129 { 129 {
130 m_client->focusedNodeChanged(node); 130 m_client->focusedNodeChanged(node);
131 } 131 }
132 132
133 void Chrome::show(NavigationPolicy policy) const 133 void Chrome::show(NavigationPolicy policy) const
134 { 134 {
135 m_client->show(policy); 135 m_client->show(policy);
136 } 136 }
137 137
138 bool Chrome::canRunModal() const
139 {
140 return m_client->canRunModal();
141 }
142
143 static bool canRunModalIfDuringPageDismissal(Page* page, ChromeClient::DialogTyp e dialog, const String& message) 138 static bool canRunModalIfDuringPageDismissal(Page* page, ChromeClient::DialogTyp e dialog, const String& message)
144 { 139 {
145 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverse Next()) { 140 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverse Next()) {
146 Document::PageDismissalType dismissal = frame->document()->pageDismissal EventBeingDispatched(); 141 Document::PageDismissalType dismissal = frame->document()->pageDismissal EventBeingDispatched();
147 if (dismissal != Document::NoDismissal) 142 if (dismissal != Document::NoDismissal)
148 return page->chrome().client().shouldRunModalDialogDuringPageDismiss al(dialog, message, dismissal); 143 return page->chrome().client().shouldRunModalDialogDuringPageDismiss al(dialog, message, dismissal);
149 } 144 }
150 return true; 145 return true;
151 } 146 }
152 147
153 bool Chrome::canRunModalNow() const
154 {
155 return canRunModal() && canRunModalIfDuringPageDismissal(m_page, ChromeClien t::HTMLDialog, String());
156 }
157
158 void Chrome::runModal() const
159 {
160 // Defer callbacks in all the other pages, so we don't try to run JavaScript
161 // in a way that could interact with this view.
162 ScopedPageLoadDeferrer deferrer(m_page);
163
164 TimerBase::fireTimersInNestedEventLoop();
165 m_client->runModal();
166 }
167
168 void Chrome::setWindowFeatures(const WindowFeatures& features) const 148 void Chrome::setWindowFeatures(const WindowFeatures& features) const
169 { 149 {
170 m_client->setToolbarsVisible(features.toolBarVisible || features.locationBar Visible); 150 m_client->setToolbarsVisible(features.toolBarVisible || features.locationBar Visible);
171 m_client->setStatusbarVisible(features.statusBarVisible); 151 m_client->setStatusbarVisible(features.statusBarVisible);
172 m_client->setScrollbarsVisible(features.scrollbarsVisible); 152 m_client->setScrollbarsVisible(features.scrollbarsVisible);
173 m_client->setMenubarVisible(features.menuBarVisible); 153 m_client->setMenubarVisible(features.menuBarVisible);
174 m_client->setResizable(features.resizable); 154 m_client->setResizable(features.resizable);
175 } 155 }
176 156
177 bool Chrome::toolbarsVisible() const 157 bool Chrome::toolbarsVisible() const
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 380 }
401 381
402 void Chrome::notifyPopupOpeningObservers() const 382 void Chrome::notifyPopupOpeningObservers() const
403 { 383 {
404 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); 384 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers);
405 for (size_t i = 0; i < observers.size(); ++i) 385 for (size_t i = 0; i < observers.size(); ++i)
406 observers[i]->willOpenPopup(); 386 observers[i]->willOpenPopup();
407 } 387 }
408 388
409 } // namespace WebCore 389 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/Chrome.h ('k') | Source/core/page/ChromeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698