| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 class Event; | 41 class Event; |
| 42 class Page; | 42 class Page; |
| 43 | 43 |
| 44 class ContextMenuController { | 44 class ContextMenuController { |
| 45 WTF_MAKE_NONCOPYABLE(ContextMenuController); WTF_MAKE_FAST_ALLOCATED; | 45 WTF_MAKE_NONCOPYABLE(ContextMenuController); WTF_MAKE_FAST_ALLOCATED; |
| 46 public: | 46 public: |
| 47 ~ContextMenuController(); | 47 ~ContextMenuController(); |
| 48 | 48 |
| 49 static PassOwnPtr<ContextMenuController> create(Page*, ContextMenuClient
*); | 49 static PassOwnPtr<ContextMenuController> create(Page*, ContextMenuClient
*); |
| 50 | 50 |
| 51 ContextMenuClient* client() const { return m_client; } | |
| 52 | |
| 53 ContextMenu* contextMenu() const { return m_contextMenu.get(); } | 51 ContextMenu* contextMenu() const { return m_contextMenu.get(); } |
| 54 void clearContextMenu(); | 52 void clearContextMenu(); |
| 55 | 53 |
| 56 void handleContextMenuEvent(Event*); | 54 void handleContextMenuEvent(Event*); |
| 57 void showContextMenu(Event*, PassRefPtr<ContextMenuProvider>); | 55 void showContextMenu(Event*, PassRefPtr<ContextMenuProvider>); |
| 58 | 56 |
| 59 void populate(); | |
| 60 void contextMenuItemSelected(const ContextMenuItem*); | 57 void contextMenuItemSelected(const ContextMenuItem*); |
| 61 void addInspectElementItem(); | |
| 62 | 58 |
| 63 void checkOrEnableIfNeeded(ContextMenuItem&) const; | |
| 64 | |
| 65 void setHitTestResult(const HitTestResult& result) { m_hitTestResult = r
esult; } | |
| 66 const HitTestResult& hitTestResult() { return m_hitTestResult; } | 59 const HitTestResult& hitTestResult() { return m_hitTestResult; } |
| 67 | 60 |
| 68 private: | 61 private: |
| 69 ContextMenuController(Page*, ContextMenuClient*); | 62 ContextMenuController(Page*, ContextMenuClient*); |
| 70 | 63 |
| 71 PassOwnPtr<ContextMenu> createContextMenu(Event*); | 64 PassOwnPtr<ContextMenu> createContextMenu(Event*); |
| 72 void showContextMenu(Event*); | 65 void showContextMenu(Event*); |
| 73 | 66 |
| 74 void appendItem(ContextMenuItem&, ContextMenu* parentMenu); | |
| 75 | |
| 76 void createAndAppendFontSubMenu(ContextMenuItem&); | |
| 77 void createAndAppendSpellingAndGrammarSubMenu(ContextMenuItem&); | |
| 78 void createAndAppendSpellingSubMenu(ContextMenuItem&); | |
| 79 void createAndAppendSpeechSubMenu(ContextMenuItem& ); | |
| 80 void createAndAppendWritingDirectionSubMenu(ContextMenuItem&); | |
| 81 void createAndAppendTextDirectionSubMenu(ContextMenuItem&); | |
| 82 void createAndAppendSubstitutionsSubMenu(ContextMenuItem&); | |
| 83 void createAndAppendTransformationsSubMenu(ContextMenuItem&); | |
| 84 | |
| 85 Page* m_page; | 67 Page* m_page; |
| 86 ContextMenuClient* m_client; | 68 ContextMenuClient* m_client; |
| 87 OwnPtr<ContextMenu> m_contextMenu; | 69 OwnPtr<ContextMenu> m_contextMenu; |
| 88 RefPtr<ContextMenuProvider> m_menuProvider; | 70 RefPtr<ContextMenuProvider> m_menuProvider; |
| 89 HitTestResult m_hitTestResult; | 71 HitTestResult m_hitTestResult; |
| 90 }; | 72 }; |
| 91 | 73 |
| 92 } | 74 } |
| 93 | 75 |
| 94 #endif | 76 #endif |
| OLD | NEW |