summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/ContextMenuController.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/page/ContextMenuController.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/page/ContextMenuController.h')
-rw-r--r--Source/WebCore/page/ContextMenuController.h111
1 files changed, 56 insertions, 55 deletions
diff --git a/Source/WebCore/page/ContextMenuController.h b/Source/WebCore/page/ContextMenuController.h
index fef13537d..f639648b1 100644
--- a/Source/WebCore/page/ContextMenuController.h
+++ b/Source/WebCore/page/ContextMenuController.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -23,77 +23,78 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ContextMenuController_h
-#define ContextMenuController_h
+#pragma once
#if ENABLE(CONTEXT_MENUS)
-#include "HitTestResult.h"
-#include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include "ContextMenuContext.h"
+#include "ContextMenuItem.h"
namespace WebCore {
- class ContextMenu;
- class ContextMenuClient;
- class ContextMenuItem;
- class ContextMenuProvider;
- class Event;
- class Page;
+class ContextMenuClient;
+class ContextMenuProvider;
+class Event;
+class Page;
- class ContextMenuController {
- WTF_MAKE_NONCOPYABLE(ContextMenuController); WTF_MAKE_FAST_ALLOCATED;
- public:
- ContextMenuController(Page&, ContextMenuClient&);
- ~ContextMenuController();
+class ContextMenuController {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ ContextMenuController(Page&, ContextMenuClient&);
+ ~ContextMenuController();
- ContextMenu* contextMenu() const { return m_contextMenu.get(); }
- void clearContextMenu();
+ Page& page() { return m_page; }
+ ContextMenuClient& client() { return m_client; }
- void handleContextMenuEvent(Event*);
- void showContextMenu(Event*, PassRefPtr<ContextMenuProvider>);
+ ContextMenu* contextMenu() const { return m_contextMenu.get(); }
+ WEBCORE_EXPORT void clearContextMenu();
- void populate();
- void contextMenuItemSelected(ContextMenuItem*);
- void addInspectElementItem();
+ void handleContextMenuEvent(Event&);
+ void showContextMenu(Event&, ContextMenuProvider&);
- void checkOrEnableIfNeeded(ContextMenuItem&) const;
+ void populate();
+ WEBCORE_EXPORT void contextMenuItemSelected(ContextMenuAction, const String& title);
+ void addInspectElementItem();
- void setHitTestResult(const HitTestResult& result) { m_hitTestResult = result; }
- const HitTestResult& hitTestResult() { return m_hitTestResult; }
+ WEBCORE_EXPORT void checkOrEnableIfNeeded(ContextMenuItem&) const;
+
+ void setContextMenuContext(const ContextMenuContext& context) { m_context = context; }
+ const ContextMenuContext& context() const { return m_context; }
+ const HitTestResult& hitTestResult() const { return m_context.hitTestResult(); }
#if USE(ACCESSIBILITY_CONTEXT_MENUS)
- void showContextMenuAt(Frame*, const IntPoint& clickPoint);
+ void showContextMenuAt(Frame&, const IntPoint& clickPoint);
+#endif
+
+#if ENABLE(SERVICE_CONTROLS)
+ void showImageControlsMenu(Event&);
#endif
- private:
- PassOwnPtr<ContextMenu> createContextMenu(Event*);
- void showContextMenu(Event*);
-
- void appendItem(ContextMenuItem&, ContextMenu* parentMenu);
-
- void createAndAppendFontSubMenu(ContextMenuItem&);
- void createAndAppendSpellingAndGrammarSubMenu(ContextMenuItem&);
- void createAndAppendSpellingSubMenu(ContextMenuItem&);
- void createAndAppendSpeechSubMenu(ContextMenuItem& );
- void createAndAppendWritingDirectionSubMenu(ContextMenuItem&);
- void createAndAppendTextDirectionSubMenu(ContextMenuItem&);
- void createAndAppendSubstitutionsSubMenu(ContextMenuItem&);
- void createAndAppendTransformationsSubMenu(ContextMenuItem&);
+private:
+ std::unique_ptr<ContextMenu> maybeCreateContextMenu(Event&);
+ void showContextMenu(Event&);
+
+ void appendItem(ContextMenuItem&, ContextMenu* parentMenu);
+
+ void createAndAppendFontSubMenu(ContextMenuItem&);
+ void createAndAppendSpellingAndGrammarSubMenu(ContextMenuItem&);
+ void createAndAppendSpellingSubMenu(ContextMenuItem&);
+ void createAndAppendSpeechSubMenu(ContextMenuItem&);
+ void createAndAppendWritingDirectionSubMenu(ContextMenuItem&);
+ void createAndAppendTextDirectionSubMenu(ContextMenuItem&);
+ void createAndAppendSubstitutionsSubMenu(ContextMenuItem&);
+ void createAndAppendTransformationsSubMenu(ContextMenuItem&);
#if PLATFORM(GTK)
- void createAndAppendUnicodeSubMenu(ContextMenuItem&);
+ void createAndAppendUnicodeSubMenu(ContextMenuItem&);
#endif
- Page& m_page;
- ContextMenuClient& m_client;
- OwnPtr<ContextMenu> m_contextMenu;
- RefPtr<ContextMenuProvider> m_menuProvider;
- HitTestResult m_hitTestResult;
- };
+ Page& m_page;
+ ContextMenuClient& m_client;
+ std::unique_ptr<ContextMenu> m_contextMenu;
+ RefPtr<ContextMenuProvider> m_menuProvider;
+ ContextMenuContext m_context;
+};
-}
+} // namespace WebCore
#endif // ENABLE(CONTEXT_MENUS)
-#endif