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 * Copyright (C) 2010 Igalia S.L | 3 * Copyright (C) 2010 Igalia S.L |
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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 PassOwnPtr<ContextMenuController> ContextMenuController::create(Page* page, Cont
extMenuClient* client) | 53 PassOwnPtr<ContextMenuController> ContextMenuController::create(Page* page, Cont
extMenuClient* client) |
54 { | 54 { |
55 return adoptPtr(new ContextMenuController(page, client)); | 55 return adoptPtr(new ContextMenuController(page, client)); |
56 } | 56 } |
57 | 57 |
58 void ContextMenuController::clearContextMenu() | 58 void ContextMenuController::clearContextMenu() |
59 { | 59 { |
60 m_contextMenu.clear(); | 60 m_contextMenu.clear(); |
61 if (m_menuProvider) | 61 if (m_menuProvider) |
62 m_menuProvider->contextMenuCleared(); | 62 m_menuProvider->contextMenuCleared(); |
63 m_menuProvider = 0; | 63 m_menuProvider = nullptr; |
64 m_hitTestResult = HitTestResult(); | 64 m_hitTestResult = HitTestResult(); |
65 m_client->clearContextMenu(); | 65 m_client->clearContextMenu(); |
66 } | 66 } |
67 | 67 |
68 void ContextMenuController::documentDetached(Document* document) | 68 void ContextMenuController::documentDetached(Document* document) |
69 { | 69 { |
70 if (Node* innerNode = m_hitTestResult.innerNode()) { | 70 if (Node* innerNode = m_hitTestResult.innerNode()) { |
71 // Invalidate the context menu info if its target document is detached. | 71 // Invalidate the context menu info if its target document is detached. |
72 if (innerNode->document() == document) | 72 if (innerNode->document() == document) |
73 clearContextMenu(); | 73 clearContextMenu(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 ASSERT(item->type() == ActionType || item->type() == CheckableActionType); | 129 ASSERT(item->type() == ActionType || item->type() == CheckableActionType); |
130 | 130 |
131 if (item->action() < ContextMenuItemBaseCustomTag || item->action() > Contex
tMenuItemLastCustomTag) | 131 if (item->action() < ContextMenuItemBaseCustomTag || item->action() > Contex
tMenuItemLastCustomTag) |
132 return; | 132 return; |
133 | 133 |
134 ASSERT(m_menuProvider); | 134 ASSERT(m_menuProvider); |
135 m_menuProvider->contextMenuItemSelected(item); | 135 m_menuProvider->contextMenuItemSelected(item); |
136 } | 136 } |
137 | 137 |
138 } // namespace WebCore | 138 } // namespace WebCore |
OLD | NEW |