OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "ContextMenuClientImpl.h" | 32 #include "ContextMenuClientImpl.h" |
33 | 33 |
34 #include "CSSPropertyNames.h" | 34 #include "CSSPropertyNames.h" |
35 #include "HTMLNames.h" | 35 #include "HTMLNames.h" |
36 #include "WebContextMenuData.h" | 36 #include "WebContextMenuData.h" |
37 #include "WebDataSourceImpl.h" | 37 #include "WebDataSourceImpl.h" |
38 #include "WebFormElement.h" | 38 #include "WebFormElement.h" |
| 39 #include "WebFrameClient.h" |
39 #include "WebFrameImpl.h" | 40 #include "WebFrameImpl.h" |
40 #include "WebMenuItemInfo.h" | 41 #include "WebMenuItemInfo.h" |
41 #include "WebPlugin.h" | 42 #include "WebPlugin.h" |
42 #include "WebPluginContainerImpl.h" | 43 #include "WebPluginContainerImpl.h" |
43 #include "WebSearchableFormData.h" | 44 #include "WebSearchableFormData.h" |
44 #include "WebSpellCheckClient.h" | 45 #include "WebSpellCheckClient.h" |
45 #include "WebViewClient.h" | 46 #include "WebViewClient.h" |
46 #include "WebViewImpl.h" | 47 #include "WebViewImpl.h" |
47 #include "bindings/v8/ExceptionStatePlaceholder.h" | 48 #include "bindings/v8/ExceptionStatePlaceholder.h" |
48 #include "core/css/CSSStyleDeclaration.h" | 49 #include "core/css/CSSStyleDeclaration.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 if (ds) | 359 if (ds) |
359 data.securityInfo = ds->response().securityInfo(); | 360 data.securityInfo = ds->response().securityInfo(); |
360 | 361 |
361 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document
()->referrerPolicy()); | 362 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document
()->referrerPolicy()); |
362 | 363 |
363 // Filter out custom menu elements and add them into the data. | 364 // Filter out custom menu elements and add them into the data. |
364 populateCustomMenuItems(defaultMenu, &data); | 365 populateCustomMenuItems(defaultMenu, &data); |
365 | 366 |
366 data.node = r.innerNonSharedNode(); | 367 data.node = r.innerNonSharedNode(); |
367 | 368 |
368 WebFrame* selected_web_frame = WebFrameImpl::fromFrame(selectedFrame); | 369 WebFrameImpl* selectedWebFrame = WebFrameImpl::fromFrame(selectedFrame); |
369 if (m_webView->client()) | 370 if (selectedWebFrame->client()) |
370 m_webView->client()->showContextMenu(selected_web_frame, data); | 371 selectedWebFrame->client()->showContextMenu(data); |
371 } | 372 } |
372 | 373 |
373 void ContextMenuClientImpl::clearContextMenu() | 374 void ContextMenuClientImpl::clearContextMenu() |
374 { | 375 { |
375 if (m_webView->client()) | 376 if (m_webView->client()) |
376 m_webView->client()->clearContextMenu(); | 377 m_webView->client()->clearContextMenu(); |
377 } | 378 } |
378 | 379 |
379 static void populateSubMenuItems(const Vector<ContextMenuItem>& inputMenu, WebVe
ctor<WebMenuItemInfo>& subMenuItems) | 380 static void populateSubMenuItems(const Vector<ContextMenuItem>& inputMenu, WebVe
ctor<WebMenuItemInfo>& subMenuItems) |
380 { | 381 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 outputItems[i] = subItems[i]; | 413 outputItems[i] = subItems[i]; |
413 subMenuItems.swap(outputItems); | 414 subMenuItems.swap(outputItems); |
414 } | 415 } |
415 | 416 |
416 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) | 417 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) |
417 { | 418 { |
418 populateSubMenuItems(defaultMenu->items(), data->customItems); | 419 populateSubMenuItems(defaultMenu->items(), data->customItems); |
419 } | 420 } |
420 | 421 |
421 } // namespace blink | 422 } // namespace blink |
OLD | NEW |