| 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 11 matching lines...) Expand all Loading... |
| 22 #include "core/page/ChromeClient.h" | 22 #include "core/page/ChromeClient.h" |
| 23 | 23 |
| 24 #include "core/dom/Document.h" | 24 #include "core/dom/Document.h" |
| 25 #include "core/dom/Element.h" | 25 #include "core/dom/Element.h" |
| 26 #include "core/frame/FrameConsole.h" | 26 #include "core/frame/FrameConsole.h" |
| 27 #include "core/frame/LocalFrame.h" | 27 #include "core/frame/LocalFrame.h" |
| 28 #include "core/inspector/ConsoleMessage.h" | 28 #include "core/inspector/ConsoleMessage.h" |
| 29 #include "core/inspector/InspectorInstrumentation.h" | 29 #include "core/inspector/InspectorInstrumentation.h" |
| 30 #include "core/layout/HitTestResult.h" | 30 #include "core/layout/HitTestResult.h" |
| 31 #include "core/page/FrameTree.h" | 31 #include "core/page/FrameTree.h" |
| 32 #include "core/page/ScopedPageLoadDeferrer.h" | 32 #include "core/page/ScopedPageSuspender.h" |
| 33 #include "core/page/WindowFeatures.h" | 33 #include "core/page/WindowFeatures.h" |
| 34 #include "platform/geometry/IntRect.h" | 34 #include "platform/geometry/IntRect.h" |
| 35 #include "platform/network/NetworkHints.h" | 35 #include "platform/network/NetworkHints.h" |
| 36 #include "public/platform/WebScreenInfo.h" | 36 #include "public/platform/WebScreenInfo.h" |
| 37 #include <algorithm> | 37 #include <algorithm> |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 void ChromeClient::setWindowRectWithAdjustment(const IntRect& pendingRect, | 41 void ChromeClient::setWindowRectWithAdjustment(const IntRect& pendingRect, |
| 42 LocalFrame& frame) { | 42 LocalFrame& frame) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 setScrollbarsVisible(features.scrollbarsVisible); | 83 setScrollbarsVisible(features.scrollbarsVisible); |
| 84 setMenubarVisible(features.menuBarVisible); | 84 setMenubarVisible(features.menuBarVisible); |
| 85 setResizable(features.resizable); | 85 setResizable(features.resizable); |
| 86 } | 86 } |
| 87 | 87 |
| 88 template <typename Delegate> | 88 template <typename Delegate> |
| 89 static bool openJavaScriptDialog(LocalFrame* frame, | 89 static bool openJavaScriptDialog(LocalFrame* frame, |
| 90 const String& message, | 90 const String& message, |
| 91 ChromeClient::DialogType dialogType, | 91 ChromeClient::DialogType dialogType, |
| 92 const Delegate& delegate) { | 92 const Delegate& delegate) { |
| 93 // Defer loads in case the client method runs a new event loop that would | 93 // Suspend pages in case the client method runs a new event loop that would |
| 94 // otherwise cause the load to continue while we're in the middle of | 94 // otherwise cause the load to continue while we're in the middle of |
| 95 // executing JavaScript. | 95 // executing JavaScript. |
| 96 ScopedPageLoadDeferrer deferrer; | 96 ScopedPageSuspender suspender; |
| 97 InspectorInstrumentation::willRunJavaScriptDialog(frame, message, dialogType); | 97 InspectorInstrumentation::willRunJavaScriptDialog(frame, message, dialogType); |
| 98 bool result = delegate(); | 98 bool result = delegate(); |
| 99 InspectorInstrumentation::didRunJavaScriptDialog(frame, result); | 99 InspectorInstrumentation::didRunJavaScriptDialog(frame, result); |
| 100 return result; | 100 return result; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool ChromeClient::openBeforeUnloadConfirmPanel(const String& message, | 103 bool ChromeClient::openBeforeUnloadConfirmPanel(const String& message, |
| 104 LocalFrame* frame, | 104 LocalFrame* frame, |
| 105 bool isReload) { | 105 bool isReload) { |
| 106 ASSERT(frame); | 106 ASSERT(frame); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 bool ChromeClient::print(LocalFrame* frame) { | 202 bool ChromeClient::print(LocalFrame* frame) { |
| 203 if (frame->document()->isSandboxed(SandboxModals)) { | 203 if (frame->document()->isSandboxed(SandboxModals)) { |
| 204 UseCounter::count(frame, UseCounter::DialogInSandboxedContext); | 204 UseCounter::count(frame, UseCounter::DialogInSandboxedContext); |
| 205 frame->console().addMessage(ConsoleMessage::create( | 205 frame->console().addMessage(ConsoleMessage::create( |
| 206 SecurityMessageSource, ErrorMessageLevel, | 206 SecurityMessageSource, ErrorMessageLevel, |
| 207 "Ignored call to 'print()'. The document is sandboxed, and the " | 207 "Ignored call to 'print()'. The document is sandboxed, and the " |
| 208 "'allow-modals' keyword is not set.")); | 208 "'allow-modals' keyword is not set.")); |
| 209 return false; | 209 return false; |
| 210 } | 210 } |
| 211 | 211 |
| 212 // Defer loads in case the client method runs a new event loop that would | 212 // Suspend pages in case the client method runs a new event loop that would |
| 213 // otherwise cause the load to continue while we're in the middle of | 213 // otherwise cause the load to continue while we're in the middle of |
| 214 // executing JavaScript. | 214 // executing JavaScript. |
| 215 ScopedPageLoadDeferrer deferrer; | 215 ScopedPageSuspender suspender; |
| 216 | 216 |
| 217 printDelegate(frame); | 217 printDelegate(frame); |
| 218 return true; | 218 return true; |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace blink | 221 } // namespace blink |
| OLD | NEW |