| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 String InspectorFrontendHost::loadSessionSetting(const String& key) | 229 String InspectorFrontendHost::loadSessionSetting(const String& key) |
| 230 { | 230 { |
| 231 String value; | 231 String value; |
| 232 if (m_client) | 232 if (m_client) |
| 233 m_client->loadSessionSetting(key, &value); | 233 m_client->loadSessionSetting(key, &value); |
| 234 return value; | 234 return value; |
| 235 } | 235 } |
| 236 | 236 |
| 237 void InspectorFrontendHost::sendMessageToBackend(const String& message) | 237 void InspectorFrontendHost::sendMessageToBackend(const String& message) |
| 238 { | 238 { |
| 239 m_client->sendMessageToBackend(message); | 239 if (m_client) |
| 240 m_client->sendMessageToBackend(message); |
| 240 } | 241 } |
| 241 | 242 |
| 242 #if ENABLE(CONTEXT_MENUS) | 243 #if ENABLE(CONTEXT_MENUS) |
| 243 void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMe
nuItem*>& items) | 244 void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMe
nuItem*>& items) |
| 244 { | 245 { |
| 245 ASSERT(m_frontendPage); | 246 ASSERT(m_frontendPage); |
| 246 ScriptState* frontendScriptState = scriptStateFromPage(debuggerWorld(), m_fr
ontendPage); | 247 ScriptState* frontendScriptState = scriptStateFromPage(debuggerWorld(), m_fr
ontendPage); |
| 247 ScriptObject webInspectorObj; | 248 ScriptObject webInspectorObj; |
| 248 if (!ScriptGlobalObject::get(frontendScriptState, "WebInspector", webInspect
orObj)) { | 249 if (!ScriptGlobalObject::get(frontendScriptState, "WebInspector", webInspect
orObj)) { |
| 249 ASSERT_NOT_REACHED(); | 250 ASSERT_NOT_REACHED(); |
| 250 return; | 251 return; |
| 251 } | 252 } |
| 252 RefPtr<FrontendMenuProvider> menuProvider = FrontendMenuProvider::create(thi
s, webInspectorObj, items); | 253 RefPtr<FrontendMenuProvider> menuProvider = FrontendMenuProvider::create(thi
s, webInspectorObj, items); |
| 253 ContextMenuController* menuController = m_frontendPage->contextMenuControlle
r(); | 254 ContextMenuController* menuController = m_frontendPage->contextMenuControlle
r(); |
| 254 menuController->showContextMenu(event, menuProvider); | 255 menuController->showContextMenu(event, menuProvider); |
| 255 m_menuProvider = menuProvider.get(); | 256 m_menuProvider = menuProvider.get(); |
| 256 } | 257 } |
| 257 #endif | 258 #endif |
| 258 | 259 |
| 259 } // namespace WebCore | 260 } // namespace WebCore |
| 260 | 261 |
| 261 #endif // ENABLE(INSPECTOR) | 262 #endif // ENABLE(INSPECTOR) |
| OLD | NEW |