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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/page/CustomContextMenuProvider.h" 5 #include "core/page/CustomContextMenuProvider.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ElementTraversal.h" 8 #include "core/dom/ElementTraversal.h"
9 #include "core/events/EventDispatcher.h" 9 #include "core/events/EventDispatcher.h"
10 #include "core/events/MouseEvent.h" 10 #include "core/events/MouseEvent.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 void CustomContextMenuProvider::populateContextMenu(ContextMenu* menu) 39 void CustomContextMenuProvider::populateContextMenu(ContextMenu* menu)
40 { 40 {
41 populateContextMenuItems(*m_menu, *menu); 41 populateContextMenuItems(*m_menu, *menu);
42 } 42 }
43 43
44 void CustomContextMenuProvider::contextMenuItemSelected(const ContextMenuItem* i tem) 44 void CustomContextMenuProvider::contextMenuItemSelected(const ContextMenuItem* i tem)
45 { 45 {
46 if (HTMLElement* element = menuItemAt(item->action())) { 46 if (HTMLElement* element = menuItemAt(item->action())) {
47 RefPtrWillBeRawPtr<MouseEvent> click = MouseEvent::create(EventTypeNames ::click, m_menu->document().domWindow(), Event::create(), SimulatedClickCreation Scope::FromUserAgent); 47 RawPtr<MouseEvent> click = MouseEvent::create(EventTypeNames::click, m_m enu->document().domWindow(), Event::create(), SimulatedClickCreationScope::FromU serAgent);
48 click->setRelatedTarget(m_subjectElement.get()); 48 click->setRelatedTarget(m_subjectElement.get());
49 element->dispatchEvent(click.release()); 49 element->dispatchEvent(click.release());
50 } 50 }
51 } 51 }
52 52
53 void CustomContextMenuProvider::contextMenuCleared() 53 void CustomContextMenuProvider::contextMenuCleared()
54 { 54 {
55 m_menuItems.clear(); 55 m_menuItems.clear();
56 m_subjectElement = nullptr; 56 m_subjectElement = nullptr;
57 } 57 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 HTMLElement* CustomContextMenuProvider::menuItemAt(unsigned menuId) 132 HTMLElement* CustomContextMenuProvider::menuItemAt(unsigned menuId)
133 { 133 {
134 int itemIndex = menuId - ContextMenuItemBaseCustomTag; 134 int itemIndex = menuId - ContextMenuItemBaseCustomTag;
135 if (itemIndex < 0 || static_cast<unsigned long>(itemIndex) >= m_menuItems.si ze()) 135 if (itemIndex < 0 || static_cast<unsigned long>(itemIndex) >= m_menuItems.si ze())
136 return nullptr; 136 return nullptr;
137 return m_menuItems[itemIndex].get(); 137 return m_menuItems[itemIndex].get();
138 } 138 }
139 139
140 } // namespace blink 140 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/CustomContextMenuProvider.h ('k') | third_party/WebKit/Source/core/page/DragController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698