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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 if (selectedFrame->document()->loader()) | 261 if (selectedFrame->document()->loader()) |
262 data.frameEncoding = selectedFrame->document()->encodingName(); | 262 data.frameEncoding = selectedFrame->document()->encodingName(); |
263 | 263 |
264 // Send the frame and page URLs in any case. | 264 // Send the frame and page URLs in any case. |
265 if (!m_webView->page()->mainFrame()->isLocalFrame()) { | 265 if (!m_webView->page()->mainFrame()->isLocalFrame()) { |
266 // TODO(kenrb): This works around the problem of URLs not being | 266 // TODO(kenrb): This works around the problem of URLs not being |
267 // available for top-level frames that are in a different process. | 267 // available for top-level frames that are in a different process. |
268 // It mostly works to convert the security origin to a URL, but | 268 // It mostly works to convert the security origin to a URL, but |
269 // extensions accessing that property will not get the correct value | 269 // extensions accessing that property will not get the correct value |
270 // in that case. See https://crbug.com/534561 | 270 // in that case. See https://crbug.com/534561 |
271 WebSecurityOrigin origin = m_webView->mainFrame()->securityOrigin(); | 271 WebSecurityOrigin origin = m_webView->mainFrame()->getSecurityOrigin(); |
272 if (!origin.isNull()) | 272 if (!origin.isNull()) |
273 data.pageURL = KURL(ParsedURLString, origin.toString()); | 273 data.pageURL = KURL(ParsedURLString, origin.toString()); |
274 } else { | 274 } else { |
275 data.pageURL = urlFromFrame(toLocalFrame(m_webView->page()->mainFrame())
); | 275 data.pageURL = urlFromFrame(toLocalFrame(m_webView->page()->mainFrame())
); |
276 } | 276 } |
277 | 277 |
278 if (selectedFrame != m_webView->page()->mainFrame()) { | 278 if (selectedFrame != m_webView->page()->mainFrame()) { |
279 data.frameURL = urlFromFrame(selectedFrame); | 279 data.frameURL = urlFromFrame(selectedFrame); |
280 RefPtrWillBeRawPtr<HistoryItem> historyItem = selectedFrame->loader().cu
rrentItem(); | 280 RefPtrWillBeRawPtr<HistoryItem> historyItem = selectedFrame->loader().cu
rrentItem(); |
281 if (historyItem) | 281 if (historyItem) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 outputItems[i] = subItems[i]; | 414 outputItems[i] = subItems[i]; |
415 subMenuItems.swap(outputItems); | 415 subMenuItems.swap(outputItems); |
416 } | 416 } |
417 | 417 |
418 void ContextMenuClientImpl::populateCustomMenuItems(const ContextMenu* defaultMe
nu, WebContextMenuData* data) | 418 void ContextMenuClientImpl::populateCustomMenuItems(const ContextMenu* defaultMe
nu, WebContextMenuData* data) |
419 { | 419 { |
420 populateSubMenuItems(defaultMenu->items(), data->customItems); | 420 populateSubMenuItems(defaultMenu->items(), data->customItems); |
421 } | 421 } |
422 | 422 |
423 } // namespace blink | 423 } // namespace blink |
OLD | NEW |