OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 m_client = 0; | 130 m_client = 0; |
131 if (m_menuProvider) | 131 if (m_menuProvider) |
132 m_menuProvider->disconnect(); | 132 m_menuProvider->disconnect(); |
133 m_frontendPage = 0; | 133 m_frontendPage = 0; |
134 } | 134 } |
135 | 135 |
136 void InspectorFrontendHost::loaded() | 136 void InspectorFrontendHost::loaded() |
137 { | 137 { |
138 } | 138 } |
139 | 139 |
140 void InspectorFrontendHost::requestSetDockSide(const String& side) | |
141 { | |
142 if (!m_client) | |
143 return; | |
144 if (side == "undocked") | |
145 m_client->requestSetDockSide(InspectorFrontendClient::Undocked); | |
146 else if (side == "right") | |
147 m_client->requestSetDockSide(InspectorFrontendClient::DockedToRight); | |
148 else if (side == "bottom") | |
149 m_client->requestSetDockSide(InspectorFrontendClient::DockedToBottom); | |
150 } | |
151 | |
152 void InspectorFrontendHost::closeWindow() | 140 void InspectorFrontendHost::closeWindow() |
153 { | 141 { |
154 if (m_client) { | 142 if (m_client) { |
155 RefPtr<JSONObject> message = JSONObject::create(); | 143 RefPtr<JSONObject> message = JSONObject::create(); |
156 message->setString("method", "closeWindow"); | 144 message->setString("method", "closeWindow"); |
157 sendMessageToEmbedder(message->toJSONString()); | 145 sendMessageToEmbedder(message->toJSONString()); |
158 m_client->closeWindow(); | |
159 disconnectClient(); // Disconnect from client. | 146 disconnectClient(); // Disconnect from client. |
160 } | 147 } |
161 } | 148 } |
162 | 149 |
163 void InspectorFrontendHost::bringToFront() | |
164 { | |
165 if (m_client) | |
166 m_client->bringToFront(); | |
167 } | |
168 | |
169 void InspectorFrontendHost::setZoomFactor(float zoom) | 150 void InspectorFrontendHost::setZoomFactor(float zoom) |
170 { | 151 { |
171 m_frontendPage->mainFrame()->setPageAndTextZoomFactors(zoom, 1); | 152 m_frontendPage->mainFrame()->setPageAndTextZoomFactors(zoom, 1); |
172 } | 153 } |
173 | 154 |
174 void InspectorFrontendHost::inspectedURLChanged(const String& newURL) | 155 void InspectorFrontendHost::inspectedURLChanged(const String& newURL) |
175 { | 156 { |
176 if (m_client) | 157 if (m_client) |
177 m_client->inspectedURLChanged(newURL); | 158 m_client->inspectedURLChanged(newURL); |
178 } | 159 } |
179 | 160 |
180 void InspectorFrontendHost::setAttachedWindowHeight(unsigned height) | 161 void InspectorFrontendHost::setAttachedWindowHeight(unsigned height) |
181 { | 162 { |
182 if (m_client) | |
183 m_client->changeAttachedWindowHeight(height); | |
184 } | |
185 | |
186 void InspectorFrontendHost::moveWindowBy(float x, float y) const | |
187 { | |
188 if (m_client) | |
189 m_client->moveWindowBy(x, y); | |
190 } | 163 } |
191 | 164 |
192 void InspectorFrontendHost::setInjectedScriptForOrigin(const String& origin, con
st String& script) | 165 void InspectorFrontendHost::setInjectedScriptForOrigin(const String& origin, con
st String& script) |
193 { | 166 { |
194 m_frontendPage->inspectorController().setInjectedScriptForOrigin(origin, scr
ipt); | 167 m_frontendPage->inspectorController().setInjectedScriptForOrigin(origin, scr
ipt); |
195 } | 168 } |
196 | 169 |
197 String InspectorFrontendHost::localizedStringsURL() | 170 String InspectorFrontendHost::localizedStringsURL() |
198 { | 171 { |
199 return ""; | 172 return ""; |
200 } | 173 } |
201 | 174 |
202 void InspectorFrontendHost::copyText(const String& text) | 175 void InspectorFrontendHost::copyText(const String& text) |
203 { | 176 { |
204 Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmar
tReplace); | 177 Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmar
tReplace); |
205 } | 178 } |
206 | 179 |
207 void InspectorFrontendHost::openInNewTab(const String& url) | |
208 { | |
209 if (m_client) | |
210 m_client->openInNewTab(url); | |
211 } | |
212 | |
213 bool InspectorFrontendHost::canSave() | 180 bool InspectorFrontendHost::canSave() |
214 { | 181 { |
215 return true; | 182 return true; |
216 } | 183 } |
217 | 184 |
218 void InspectorFrontendHost::save(const String& url, const String& content, bool
forceSaveAs) | |
219 { | |
220 if (m_client) | |
221 m_client->save(url, content, forceSaveAs); | |
222 } | |
223 | |
224 void InspectorFrontendHost::append(const String& url, const String& content) | |
225 { | |
226 if (m_client) | |
227 m_client->append(url, content); | |
228 } | |
229 | |
230 void InspectorFrontendHost::close(const String&) | 185 void InspectorFrontendHost::close(const String&) |
231 { | 186 { |
232 } | 187 } |
233 | 188 |
234 void InspectorFrontendHost::sendMessageToBackend(const String& message) | 189 void InspectorFrontendHost::sendMessageToBackend(const String& message) |
235 { | 190 { |
236 if (m_client) | 191 if (m_client) |
237 m_client->sendMessageToBackend(message); | 192 m_client->sendMessageToBackend(message); |
238 } | 193 } |
239 | 194 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 { | 244 { |
290 Color color = RenderTheme::theme().activeSelectionForegroundColor(); | 245 Color color = RenderTheme::theme().activeSelectionForegroundColor(); |
291 return color.isValid() ? color.serialized() : ""; | 246 return color.isValid() ? color.serialized() : ""; |
292 } | 247 } |
293 | 248 |
294 bool InspectorFrontendHost::supportsFileSystems() | 249 bool InspectorFrontendHost::supportsFileSystems() |
295 { | 250 { |
296 return true; | 251 return true; |
297 } | 252 } |
298 | 253 |
299 void InspectorFrontendHost::requestFileSystems() | |
300 { | |
301 if (m_client) | |
302 m_client->requestFileSystems(); | |
303 } | |
304 | |
305 void InspectorFrontendHost::addFileSystem() | |
306 { | |
307 if (m_client) | |
308 m_client->addFileSystem(); | |
309 } | |
310 | |
311 void InspectorFrontendHost::removeFileSystem(const String& fileSystemPath) | |
312 { | |
313 if (m_client) | |
314 m_client->removeFileSystem(fileSystemPath); | |
315 } | |
316 | |
317 PassRefPtr<DOMFileSystem> InspectorFrontendHost::isolatedFileSystem(const String
& fileSystemName, const String& rootURL) | 254 PassRefPtr<DOMFileSystem> InspectorFrontendHost::isolatedFileSystem(const String
& fileSystemName, const String& rootURL) |
318 { | 255 { |
319 ScriptExecutionContext* context = m_frontendPage->mainFrame()->document(); | 256 ScriptExecutionContext* context = m_frontendPage->mainFrame()->document(); |
320 return DOMFileSystem::create(context, fileSystemName, FileSystemTypeIsolated
, KURL(ParsedURLString, rootURL), AsyncFileSystem::create()); | 257 return DOMFileSystem::create(context, fileSystemName, FileSystemTypeIsolated
, KURL(ParsedURLString, rootURL), AsyncFileSystem::create()); |
321 } | 258 } |
322 | 259 |
323 void InspectorFrontendHost::indexPath(int requestId, const String& fileSystemPat
h) | |
324 { | |
325 if (m_client) | |
326 m_client->indexPath(requestId, fileSystemPath); | |
327 } | |
328 | |
329 void InspectorFrontendHost::stopIndexing(int requestId) | |
330 { | |
331 if (m_client) | |
332 m_client->stopIndexing(requestId); | |
333 } | |
334 | |
335 void InspectorFrontendHost::searchInPath(int requestId, const String& fileSystem
Path, const String& query) | |
336 { | |
337 if (m_client) | |
338 m_client->searchInPath(requestId, fileSystemPath, query); | |
339 } | |
340 | |
341 bool InspectorFrontendHost::isUnderTest() | 260 bool InspectorFrontendHost::isUnderTest() |
342 { | 261 { |
343 return m_client && m_client->isUnderTest(); | 262 return m_client && m_client->isUnderTest(); |
344 } | 263 } |
345 | 264 |
346 bool InspectorFrontendHost::canSaveAs() | 265 bool InspectorFrontendHost::canSaveAs() |
347 { | 266 { |
348 return false; | 267 return false; |
349 } | 268 } |
350 | 269 |
351 bool InspectorFrontendHost::canInspectWorkers() | 270 bool InspectorFrontendHost::canInspectWorkers() |
352 { | 271 { |
353 return false; | 272 return false; |
354 } | 273 } |
355 | 274 |
356 String InspectorFrontendHost::hiddenPanels() | 275 String InspectorFrontendHost::hiddenPanels() |
357 { | 276 { |
358 return ""; | 277 return ""; |
359 } | 278 } |
360 | 279 |
361 } // namespace WebCore | 280 } // namespace WebCore |
OLD | NEW |