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 26 matching lines...) Expand all Loading... |
37 #include "core/inspector/DevToolsHost.h" | 37 #include "core/inspector/DevToolsHost.h" |
38 #include "public/platform/WebSecurityOrigin.h" | 38 #include "public/platform/WebSecurityOrigin.h" |
39 #include "public/platform/WebString.h" | 39 #include "public/platform/WebString.h" |
40 #include "public/web/WebDevToolsFrontendClient.h" | 40 #include "public/web/WebDevToolsFrontendClient.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 WebDevToolsFrontend* WebDevToolsFrontend::create( |
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, | 47 WebLocalFrame* frame, |
56 WebDevToolsFrontendClient* client, | 48 WebDevToolsFrontendClient* client) |
57 const WebString& applicationLocale) | |
58 { | 49 { |
59 return new WebDevToolsFrontendImpl(toWebLocalFrameImpl(frame), client); | 50 return new WebDevToolsFrontendImpl(toWebLocalFrameImpl(frame), client); |
60 } | 51 } |
61 | 52 |
62 WebDevToolsFrontendImpl::WebDevToolsFrontendImpl( | 53 WebDevToolsFrontendImpl::WebDevToolsFrontendImpl( |
63 WebLocalFrameImpl* webFrame, | 54 WebLocalFrameImpl* webFrame, |
64 WebDevToolsFrontendClient* client) | 55 WebDevToolsFrontendClient* client) |
65 : m_webFrame(webFrame) | 56 : m_webFrame(webFrame) |
66 , m_client(client) | 57 , m_client(client) |
67 { | 58 { |
68 m_webFrame->setDevToolsFrontend(this); | 59 m_webFrame->setDevToolsFrontend(this); |
69 } | 60 } |
70 | 61 |
71 WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() | 62 WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() |
72 { | 63 { |
| 64 if (m_devtoolsHost) |
| 65 m_devtoolsHost->disconnectClient(); |
73 } | 66 } |
74 | 67 |
75 void WebDevToolsFrontendImpl::didClearWindowObject(WebLocalFrameImpl* frame) | 68 void WebDevToolsFrontendImpl::didClearWindowObject(WebLocalFrameImpl* frame) |
76 { | 69 { |
77 if (m_webFrame == frame) { | 70 if (m_webFrame == frame) { |
78 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 71 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
79 ScriptState* scriptState = ScriptState::forMainWorld(m_webFrame->frame()
); | 72 ScriptState* scriptState = ScriptState::forMainWorld(m_webFrame->frame()
); |
80 ScriptState::Scope scope(scriptState); | 73 ScriptState::Scope scope(scriptState); |
81 | 74 |
82 if (m_devtoolsHost) | 75 if (m_devtoolsHost) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 { | 112 { |
120 WebLocalFrameImpl::fromFrame(targetFrame)->viewImpl()->showContextMenuAtPoin
t(x, y, menuProvider); | 113 WebLocalFrameImpl::fromFrame(targetFrame)->viewImpl()->showContextMenuAtPoin
t(x, y, menuProvider); |
121 } | 114 } |
122 | 115 |
123 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, c
onst String& source) | 116 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, c
onst String& source) |
124 { | 117 { |
125 m_injectedScriptForOrigin.set(origin, source); | 118 m_injectedScriptForOrigin.set(origin, source); |
126 } | 119 } |
127 | 120 |
128 } // namespace blink | 121 } // namespace blink |
OLD | NEW |