Chromium Code Reviews| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 if (!result.innerNodeOrImageMapImage()) | 166 if (!result.innerNodeOrImageMapImage()) |
| 167 return nullptr; | 167 return nullptr; |
| 168 | 168 |
| 169 m_hitTestResult = result; | 169 m_hitTestResult = result; |
| 170 | 170 |
| 171 return adoptPtr(new ContextMenu); | 171 return adoptPtr(new ContextMenu); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void ContextMenuController::showContextMenu(Event* event) | 174 void ContextMenuController::showContextMenu(Event* event) |
| 175 { | 175 { |
| 176 m_client->showContextMenu(m_contextMenu.get()); | 176 m_client->showContextMenu(m_contextMenu.get(), event); |
|
tkent
2016/02/05 02:05:47
|event| can be nullptr. It causes a crash in appe
JakeYoon
2016/02/05 04:04:49
How do you think to add to check nullptr in append
zino
2016/02/05 05:47:34
I'm not owner but I think you could modify appendS
tkent
2016/02/05 06:00:45
Check it in ContextMenuClientImpl::showContextMenu
JakeYoon
2016/02/05 07:28:34
Okay, I think so too
| |
| 177 if (event) | 177 if (event) |
| 178 event->setDefaultHandled(); | 178 event->setDefaultHandled(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void ContextMenuController::contextMenuItemSelected(const ContextMenuItem* item) | 181 void ContextMenuController::contextMenuItemSelected(const ContextMenuItem* item) |
| 182 { | 182 { |
| 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 |
| OLD | NEW |