Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: third_party/WebKit/Source/core/page/ContextMenuController.cpp

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Fix typo Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 Node* node = event.target()->toNode(); 92 Node* node = event.target()->toNode();
93 if (!node || !node->isHTMLElement()) 93 if (!node || !node->isHTMLElement())
94 return; 94 return;
95 95
96 HTMLElement& element = toHTMLElement(*node); 96 HTMLElement& element = toHTMLElement(*node);
97 RefPtrWillBeRawPtr<HTMLMenuElement> menuElement = element.assignedContextMen u(); 97 RefPtrWillBeRawPtr<HTMLMenuElement> menuElement = element.assignedContextMen u();
98 if (!menuElement || !equalIgnoringCase(menuElement->fastGetAttribute(typeAtt r), "context")) 98 if (!menuElement || !equalIgnoringCase(menuElement->fastGetAttribute(typeAtt r), "context"))
99 return; 99 return;
100 RefPtrWillBeRawPtr<RelatedEvent> relatedEvent = RelatedEvent::create(EventTy peNames::show, true, true, node); 100 RefPtrWillBeRawPtr<RelatedEvent> relatedEvent = RelatedEvent::create(EventTy peNames::show, true, true, node);
101 if (!menuElement->dispatchEvent(relatedEvent.release())) 101 if (menuElement->dispatchEvent(relatedEvent.release()) != DispatchEventResul t::NotCanceled)
102 return; 102 return;
103 if (menuElement != element.assignedContextMenu()) 103 if (menuElement != element.assignedContextMenu())
104 return; 104 return;
105 m_menuProvider = CustomContextMenuProvider::create(*menuElement, element); 105 m_menuProvider = CustomContextMenuProvider::create(*menuElement, element);
106 m_menuProvider->populateContextMenu(m_contextMenu.get()); 106 m_menuProvider->populateContextMenu(m_contextMenu.get());
107 } 107 }
108 108
109 void ContextMenuController::handleContextMenuEvent(Event* event) 109 void ContextMenuController::handleContextMenuEvent(Event* event)
110 { 110 {
111 m_contextMenu = createContextMenu(event); 111 m_contextMenu = createContextMenu(event);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ASSERT(item->type() == ActionType || item->type() == CheckableActionType); 183 ASSERT(item->type() == ActionType || item->type() == CheckableActionType);
184 184
185 if (item->action() < ContextMenuItemBaseCustomTag || item->action() > Contex tMenuItemLastCustomTag) 185 if (item->action() < ContextMenuItemBaseCustomTag || item->action() > Contex tMenuItemLastCustomTag)
186 return; 186 return;
187 187
188 ASSERT(m_menuProvider); 188 ASSERT(m_menuProvider);
189 m_menuProvider->contextMenuItemSelected(item); 189 m_menuProvider->contextMenuItemSelected(item);
190 } 190 }
191 191
192 } // namespace blink 192 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.cpp ('k') | third_party/WebKit/Source/core/page/DragController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698