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

Side by Side Diff: webkit/api/src/ContextMenuClientImpl.cpp

Issue 338002: Renamed WebContextMenuClientImpl -> ContextMenuClientImpl (Closed)
Patch Set: Created 11 years, 2 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 11 matching lines...) Expand all
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "WebContextMenuClientImpl.h" 32 #include "ContextMenuClientImpl.h"
33 33
34 #include "ContextMenu.h" 34 #include "ContextMenu.h"
35 #include "Document.h" 35 #include "Document.h"
36 #include "DocumentLoader.h" 36 #include "DocumentLoader.h"
37 #include "Editor.h" 37 #include "Editor.h"
38 #include "EventHandler.h" 38 #include "EventHandler.h"
39 #include "FrameLoader.h" 39 #include "FrameLoader.h"
40 #include "FrameView.h" 40 #include "FrameView.h"
41 #include "HitTestResult.h" 41 #include "HitTestResult.h"
42 #include "HTMLMediaElement.h" 42 #include "HTMLMediaElement.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // If misspelled word is still empty, then that portion should not be 128 // If misspelled word is still empty, then that portion should not be
129 // selected. Set the selection to that position only, and do not expand. 129 // selected. Set the selection to that position only, and do not expand.
130 if (misspelledWord.isEmpty()) { 130 if (misspelledWord.isEmpty()) {
131 selection = VisibleSelection(pos); 131 selection = VisibleSelection(pos);
132 selectedFrame->selection()->setSelection(selection); 132 selectedFrame->selection()->setSelection(selection);
133 } 133 }
134 134
135 return misspelledWord; 135 return misspelledWord;
136 } 136 }
137 137
138 PlatformMenuDescription WebContextMenuClientImpl::getCustomMenuFromDefaultItems( 138 PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
139 ContextMenu* defaultMenu) 139 ContextMenu* defaultMenu)
140 { 140 {
141 // Displaying the context menu in this function is a big hack as we don't 141 // Displaying the context menu in this function is a big hack as we don't
142 // have context, i.e. whether this is being invoked via a script or in 142 // have context, i.e. whether this is being invoked via a script or in
143 // response to user input (Mouse event WM_RBUTTONDOWN, 143 // response to user input (Mouse event WM_RBUTTONDOWN,
144 // Keyboard events KeyVK_APPS, Shift+F10). Check if this is being invoked 144 // Keyboard events KeyVK_APPS, Shift+F10). Check if this is being invoked
145 // in response to the above input events before popping up the context menu. 145 // in response to the above input events before popping up the context menu.
146 if (!m_webView->context_menu_allowed()) 146 if (!m_webView->context_menu_allowed())
147 return 0; 147 return 0;
148 148
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 data.editFlags |= WebContextMenuData::CanSelectAll; 231 data.editFlags |= WebContextMenuData::CanSelectAll;
232 232
233 WebFrame* selected_web_frame = WebFrameImpl::FromFrame(selectedFrame); 233 WebFrame* selected_web_frame = WebFrameImpl::FromFrame(selectedFrame);
234 if (m_webView->client()) 234 if (m_webView->client())
235 m_webView->client()->showContextMenu(selected_web_frame, data); 235 m_webView->client()->showContextMenu(selected_web_frame, data);
236 236
237 return 0; 237 return 0;
238 } 238 }
239 239
240 } // namespace WebKit 240 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698