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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 // An image can to be null for many reasons, like being blocked, no image | 275 // An image can to be null for many reasons, like being blocked, no image |
276 // data received from server yet. | 276 // data received from server yet. |
277 data.hasImageContents = | 277 data.hasImageContents = |
278 (data.mediaType == WebContextMenuData::MediaTypeImage) | 278 (data.mediaType == WebContextMenuData::MediaTypeImage) |
279 && r.image() && !(r.image()->isNull()); | 279 && r.image() && !(r.image()->isNull()); |
280 | 280 |
281 // If it's not a link, an image, a media element, or an image/media link, | 281 // If it's not a link, an image, a media element, or an image/media link, |
282 // show a selection menu or a more generic page menu. | 282 // show a selection menu or a more generic page menu. |
283 if (selectedFrame->document()->loader()) | 283 if (selectedFrame->document()->loader()) |
284 data.frameEncoding = selectedFrame->document()->encoding(); | 284 data.frameEncoding = selectedFrame->document()->encodingName(); |
285 | 285 |
286 // Send the frame and page URLs in any case. | 286 // Send the frame and page URLs in any case. |
287 data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame()); | 287 data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame()); |
288 if (selectedFrame != m_webView->mainFrameImpl()->frame()) { | 288 if (selectedFrame != m_webView->mainFrameImpl()->frame()) { |
289 data.frameURL = urlFromFrame(selectedFrame); | 289 data.frameURL = urlFromFrame(selectedFrame); |
290 RefPtr<HistoryItem> historyItem = selectedFrame->loader()->history()->cu
rrentItem(); | 290 RefPtr<HistoryItem> historyItem = selectedFrame->loader()->history()->cu
rrentItem(); |
291 if (historyItem) | 291 if (historyItem) |
292 data.frameHistoryItem = WebHistoryItem(historyItem); | 292 data.frameHistoryItem = WebHistoryItem(historyItem); |
293 } | 293 } |
294 | 294 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 outputItems[i] = subItems[i]; | 412 outputItems[i] = subItems[i]; |
413 subMenuItems.swap(outputItems); | 413 subMenuItems.swap(outputItems); |
414 } | 414 } |
415 | 415 |
416 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) | 416 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) |
417 { | 417 { |
418 populateSubMenuItems(defaultMenu->items(), data->customItems); | 418 populateSubMenuItems(defaultMenu->items(), data->customItems); |
419 } | 419 } |
420 | 420 |
421 } // namespace WebKit | 421 } // namespace WebKit |
OLD | NEW |