WebCore/ChangeLog

 12010-04-10 Joseph Pecoraro <joepeck@webkit.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Missing CONTEXT_MENUS Guards
 6 https://bugs.webkit.org/show_bug.cgi?id=37398
 7
 8 Added missing ENABLE(CONTEXT_MENUS) guards.
 9
 10 * bindings/js/JSInspectorFrontendHostCustom.cpp:
 11 (WebCore::JSInspectorFrontendHost::showContextMenu):
 12 * inspector/InspectorFrontendHost.cpp:
 13 (WebCore::InspectorFrontendHost::InspectorFrontendHost):
 14 (WebCore::InspectorFrontendHost::disconnectClient):
 15 * inspector/InspectorFrontendHost.h:
 16
1172010-04-10 Stephan Aßmus <superstippi@gmx.de>
218
319 Reviewed by Eric Seidel.

WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp

@@JSValue JSInspectorFrontendHost::showContextMenu(ExecState* execState, const Arg
8181{
8282 if (args.size() < 2)
8383 return jsUndefined();
84 
 84#if ENABLE(CONTEXT_MENUS)
8585 Event* event = toEvent(args.at(0));
8686
8787 JSArray* array = asArray(args.at(1));

@@JSValue JSInspectorFrontendHost::showContextMenu(ExecState* execState, const Arg
100100 }
101101
102102 impl()->showContextMenu(event, items);
 103#else
 104 UNUSED_PARAM(execState);
 105#endif
103106 return jsUndefined();
104107}
105108

WebCore/inspector/InspectorFrontendHost.cpp

@@using namespace std;
5454
5555namespace WebCore {
5656
 57#if ENABLE(CONTEXT_MENUS)
5758class FrontendMenuProvider : public ContextMenuProvider {
5859public:
5960 static PassRefPtr<FrontendMenuProvider> create(InspectorFrontendHost* frontendHost, ScriptObject webInspector, const Vector<ContextMenuItem*>& items)

@@private:
115116 ScriptObject m_webInspector;
116117 Vector<ContextMenuItem*> m_items;
117118};
 119#endif
118120
119121InspectorFrontendHost::InspectorFrontendHost(InspectorFrontendClient* client, Page* frontendPage)
120122 : m_client(client)
121123 , m_frontendPage(frontendPage)
 124#if ENABLE(CONTEXT_MENUS)
122125 , m_menuProvider(0)
 126#endif
123127{
124128}
125129

@@InspectorFrontendHost::~InspectorFrontendHost()
131135void InspectorFrontendHost::disconnectClient()
132136{
133137 m_client = 0;
 138#if ENABLE(CONTEXT_MENUS)
134139 if (m_menuProvider)
135140 m_menuProvider->disconnect();
 141#endif
136142 m_frontendPage = 0;
137143}
138144

@@void InspectorFrontendHost::copyText(const String& text)
201207 Pasteboard::generalPasteboard()->writePlainText(text);
202208}
203209
 210#if ENABLE(CONTEXT_MENUS)
204211void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMenuItem*>& items)
205212{
206213 ASSERT(m_frontendPage);

@@void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMe
215222 menuController->showContextMenu(event, menuProvider);
216223 m_menuProvider = menuProvider.get();
217224}
 225#endif
218226
219227} // namespace WebCore
220228

WebCore/inspector/InspectorFrontendHost.h

@@public:
7777 void showContextMenu(Event*, const Vector<ContextMenuItem*>& items);
7878
7979private:
 80#if ENABLE(CONTEXT_MENUS)
8081 friend class FrontendMenuProvider;
 82#endif
8183 InspectorFrontendHost(InspectorFrontendClient* client, Page* frontendPage);
8284
8385 InspectorFrontendClient* m_client;
8486 Page* m_frontendPage;
 87#if ENABLE(CONTEXT_MENUS)
8588 FrontendMenuProvider* m_menuProvider;
 89#endif
8690};
8791
8892} // namespace WebCore