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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 m_devtoolsHost = DevToolsHost::create(this, m_webFrame->frame()); | 79 m_devtoolsHost = DevToolsHost::create(this, m_webFrame->frame()); |
80 v8::Local<v8::Object> global = scriptState->context()->Global(); | 80 v8::Local<v8::Object> global = scriptState->context()->Global(); |
81 v8::Local<v8::Value> devtoolsHostObj = toV8(m_devtoolsHost.get(), global
, scriptState->isolate()); | 81 v8::Local<v8::Value> devtoolsHostObj = toV8(m_devtoolsHost.get(), global
, scriptState->isolate()); |
82 ASSERT(!devtoolsHostObj.IsEmpty()); | 82 ASSERT(!devtoolsHostObj.IsEmpty()); |
83 global->Set(v8AtomicString(isolate, "DevToolsHost"), devtoolsHostObj); | 83 global->Set(v8AtomicString(isolate, "DevToolsHost"), devtoolsHostObj); |
84 } | 84 } |
85 | 85 |
86 if (m_injectedScriptForOrigin.isEmpty()) | 86 if (m_injectedScriptForOrigin.isEmpty()) |
87 return; | 87 return; |
88 | 88 |
89 String origin = frame->securityOrigin().toString(); | 89 String origin = frame->getSecurityOrigin().toString(); |
90 String script = m_injectedScriptForOrigin.get(origin); | 90 String script = m_injectedScriptForOrigin.get(origin); |
91 if (script.isEmpty()) | 91 if (script.isEmpty()) |
92 return; | 92 return; |
93 static int s_lastScriptId = 0; | 93 static int s_lastScriptId = 0; |
94 StringBuilder scriptWithId; | 94 StringBuilder scriptWithId; |
95 scriptWithId.append(script); | 95 scriptWithId.append(script); |
96 scriptWithId.append('('); | 96 scriptWithId.append('('); |
97 scriptWithId.appendNumber(++s_lastScriptId); | 97 scriptWithId.appendNumber(++s_lastScriptId); |
98 scriptWithId.append(')'); | 98 scriptWithId.append(')'); |
99 frame->frame()->script().executeScriptInMainWorld(scriptWithId.toString()); | 99 frame->frame()->script().executeScriptInMainWorld(scriptWithId.toString()); |
(...skipping 14 matching lines...) Expand all Loading... |
114 { | 114 { |
115 WebLocalFrameImpl::fromFrame(targetFrame)->viewImpl()->showContextMenuAtPoin
t(x, y, menuProvider); | 115 WebLocalFrameImpl::fromFrame(targetFrame)->viewImpl()->showContextMenuAtPoin
t(x, y, menuProvider); |
116 } | 116 } |
117 | 117 |
118 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, c
onst String& source) | 118 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, c
onst String& source) |
119 { | 119 { |
120 m_injectedScriptForOrigin.set(origin, source); | 120 m_injectedScriptForOrigin.set(origin, source); |
121 } | 121 } |
122 | 122 |
123 } // namespace blink | 123 } // namespace blink |
OLD | NEW |