OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/frame/DOMWindow.h" | 5 #include "core/frame/DOMWindow.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
8 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
9 #include "core/dom/SecurityContext.h" | 10 #include "core/dom/SecurityContext.h" |
10 #include "core/events/MessageEvent.h" | 11 #include "core/events/MessageEvent.h" |
11 #include "core/frame/Frame.h" | 12 #include "core/frame/Frame.h" |
12 #include "core/frame/FrameClient.h" | 13 #include "core/frame/FrameClient.h" |
13 #include "core/frame/FrameConsole.h" | 14 #include "core/frame/FrameConsole.h" |
14 #include "core/frame/LocalDOMWindow.h" | 15 #include "core/frame/LocalDOMWindow.h" |
15 #include "core/frame/Location.h" | 16 #include "core/frame/Location.h" |
16 #include "core/frame/Settings.h" | 17 #include "core/frame/Settings.h" |
17 #include "core/frame/UseCounter.h" | 18 #include "core/frame/UseCounter.h" |
| 19 #include "core/input/InputDeviceCapabilities.h" |
18 #include "core/inspector/ConsoleMessage.h" | 20 #include "core/inspector/ConsoleMessage.h" |
19 #include "core/inspector/InspectorInstrumentation.h" | 21 #include "core/inspector/InspectorInstrumentation.h" |
20 #include "core/loader/MixedContentChecker.h" | 22 #include "core/loader/MixedContentChecker.h" |
21 #include "core/page/ChromeClient.h" | 23 #include "core/page/ChromeClient.h" |
22 #include "core/page/FocusController.h" | 24 #include "core/page/FocusController.h" |
23 #include "core/page/Page.h" | 25 #include "core/page/Page.h" |
24 #include "platform/weborigin/KURL.h" | 26 #include "platform/weborigin/KURL.h" |
25 #include "platform/weborigin/SecurityOrigin.h" | 27 #include "platform/weborigin/SecurityOrigin.h" |
26 #include "platform/weborigin/Suborigin.h" | 28 #include "platform/weborigin/Suborigin.h" |
27 #include <memory> | |
28 | 29 |
29 namespace blink { | 30 namespace blink { |
30 | 31 |
31 DOMWindow::DOMWindow(Frame& frame) : m_frame(frame), m_windowIsClosing(false) {} | 32 DOMWindow::DOMWindow(Frame& frame) : m_frame(frame), m_windowIsClosing(false) {} |
32 | 33 |
33 DOMWindow::~DOMWindow() { | 34 DOMWindow::~DOMWindow() { |
34 // The frame must be disconnected before finalization. | 35 // The frame must be disconnected before finalization. |
35 DCHECK(!m_frame); | 36 DCHECK(!m_frame); |
36 } | 37 } |
37 | 38 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 (toDocument(context)->domWindow() == opener()); | 419 (toDocument(context)->domWindow() == opener()); |
419 } | 420 } |
420 | 421 |
421 // If we're a top level window, bring the window to the front. | 422 // If we're a top level window, bring the window to the front. |
422 if (frame()->isMainFrame() && allowFocus) | 423 if (frame()->isMainFrame() && allowFocus) |
423 page->chromeClient().focus(); | 424 page->chromeClient().focus(); |
424 | 425 |
425 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */); | 426 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */); |
426 } | 427 } |
427 | 428 |
| 429 InputDeviceCapabilitiesConstants* DOMWindow::getInputDeviceCapabilities() { |
| 430 if (!m_inputCapabilities) |
| 431 m_inputCapabilities = new InputDeviceCapabilitiesConstants; |
| 432 return m_inputCapabilities; |
| 433 } |
| 434 |
428 DEFINE_TRACE(DOMWindow) { | 435 DEFINE_TRACE(DOMWindow) { |
429 visitor->trace(m_frame); | 436 visitor->trace(m_frame); |
| 437 visitor->trace(m_inputCapabilities); |
430 visitor->trace(m_location); | 438 visitor->trace(m_location); |
431 EventTargetWithInlineData::trace(visitor); | 439 EventTargetWithInlineData::trace(visitor); |
432 } | 440 } |
433 | 441 |
434 } // namespace blink | 442 } // namespace blink |
OLD | NEW |