| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |