OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
37 #include "core/inspector/DevToolsHost.h" | 37 #include "core/inspector/DevToolsHost.h" |
38 #include "public/platform/WebString.h" | 38 #include "public/platform/WebString.h" |
39 #include "public/web/WebDevToolsFrontendClient.h" | 39 #include "public/web/WebDevToolsFrontendClient.h" |
40 #include "public/web/WebSecurityOrigin.h" | 40 #include "public/web/WebSecurityOrigin.h" |
41 #include "web/WebLocalFrameImpl.h" | 41 #include "web/WebLocalFrameImpl.h" |
42 #include "web/WebViewImpl.h" | 42 #include "web/WebViewImpl.h" |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 WebDevToolsFrontend* WebDevToolsFrontend::create( | 46 WebDevToolsFrontendImpl::WebDevToolsFrontendImpl(WebLocalFrameImpl* webFrame, We
bDevToolsFrontendClient* client) |
47 WebView* view, | |
48 WebDevToolsFrontendClient* client, | |
49 const WebString& applicationLocale) | |
50 { | |
51 return new WebDevToolsFrontendImpl(toWebLocalFrameImpl(view->mainFrame()), c
lient); | |
52 } | |
53 | |
54 WebDevToolsFrontend* WebDevToolsFrontend::create( | |
55 WebLocalFrame* frame, | |
56 WebDevToolsFrontendClient* client, | |
57 const WebString& applicationLocale) | |
58 { | |
59 return new WebDevToolsFrontendImpl(toWebLocalFrameImpl(frame), client); | |
60 } | |
61 | |
62 WebDevToolsFrontendImpl::WebDevToolsFrontendImpl( | |
63 WebLocalFrameImpl* webFrame, | |
64 WebDevToolsFrontendClient* client) | |
65 : m_webFrame(webFrame) | 47 : m_webFrame(webFrame) |
66 , m_client(client) | 48 , m_client(client) |
67 { | 49 { |
68 m_webFrame->setDevToolsFrontend(this); | 50 m_webFrame->setDevToolsFrontend(this); |
69 } | 51 } |
70 | 52 |
71 WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() | 53 WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() |
72 { | 54 { |
| 55 // Q: where is this cleared? |
73 ASSERT(!m_devtoolsHost); | 56 ASSERT(!m_devtoolsHost); |
74 } | 57 } |
75 | 58 |
| 59 DEFINE_TRACE(WebDevToolsFrontendImpl) |
| 60 { |
| 61 visitor->trace(m_webFrame); |
| 62 visitor->trace(m_devtoolsHost); |
| 63 } |
| 64 |
76 void WebDevToolsFrontendImpl::didClearWindowObject(WebLocalFrameImpl* frame) | 65 void WebDevToolsFrontendImpl::didClearWindowObject(WebLocalFrameImpl* frame) |
77 { | 66 { |
78 if (m_webFrame == frame) { | 67 if (m_webFrame == frame) { |
79 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 68 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
80 ScriptState* scriptState = ScriptState::forMainWorld(m_webFrame->frame()
); | 69 ScriptState* scriptState = ScriptState::forMainWorld(m_webFrame->frame()
); |
81 ScriptState::Scope scope(scriptState); | 70 ScriptState::Scope scope(scriptState); |
82 | 71 |
83 if (m_devtoolsHost) | 72 if (m_devtoolsHost) |
84 m_devtoolsHost->disconnectClient(); | 73 m_devtoolsHost->disconnectClient(); |
85 m_devtoolsHost = DevToolsHost::create(this, m_webFrame->frame()); | 74 m_devtoolsHost = DevToolsHost::create(this, m_webFrame->frame()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 { | 114 { |
126 WebLocalFrameImpl::fromFrame(targetFrame)->viewImpl()->showContextMenuAtPoin
t(x, y, menuProvider); | 115 WebLocalFrameImpl::fromFrame(targetFrame)->viewImpl()->showContextMenuAtPoin
t(x, y, menuProvider); |
127 } | 116 } |
128 | 117 |
129 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, c
onst String& source) | 118 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, c
onst String& source) |
130 { | 119 { |
131 m_injectedScriptForOrigin.set(origin, source); | 120 m_injectedScriptForOrigin.set(origin, source); |
132 } | 121 } |
133 | 122 |
134 } // namespace blink | 123 } // namespace blink |
OLD | NEW |