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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // in that case. See https://crbug.com/534561 | 294 // in that case. See https://crbug.com/534561 |
295 WebSecurityOrigin origin = m_webView->mainFrame()->getSecurityOrigin(); | 295 WebSecurityOrigin origin = m_webView->mainFrame()->getSecurityOrigin(); |
296 if (!origin.isNull()) | 296 if (!origin.isNull()) |
297 data.pageURL = KURL(ParsedURLString, origin.toString()); | 297 data.pageURL = KURL(ParsedURLString, origin.toString()); |
298 } else { | 298 } else { |
299 data.pageURL = urlFromFrame(toLocalFrame(m_webView->page()->mainFrame())); | 299 data.pageURL = urlFromFrame(toLocalFrame(m_webView->page()->mainFrame())); |
300 } | 300 } |
301 | 301 |
302 if (selectedFrame != m_webView->page()->mainFrame()) { | 302 if (selectedFrame != m_webView->page()->mainFrame()) { |
303 data.frameURL = urlFromFrame(selectedFrame); | 303 data.frameURL = urlFromFrame(selectedFrame); |
304 HistoryItem* historyItem = selectedFrame->loader().currentItem(); | 304 HistoryItem* historyItem = |
| 305 selectedFrame->loader().documentLoader()->historyItem(); |
305 if (historyItem) | 306 if (historyItem) |
306 data.frameHistoryItem = WebHistoryItem(historyItem); | 307 data.frameHistoryItem = WebHistoryItem(historyItem); |
307 } | 308 } |
308 | 309 |
309 // HitTestResult::isSelected() ensures clean layout by performing a hit test. | 310 // HitTestResult::isSelected() ensures clean layout by performing a hit test. |
310 if (r.isSelected()) { | 311 if (r.isSelected()) { |
311 if (!isHTMLInputElement(*r.innerNode()) || | 312 if (!isHTMLInputElement(*r.innerNode()) || |
312 toHTMLInputElement(r.innerNode())->type() != InputTypeNames::password) { | 313 toHTMLInputElement(r.innerNode())->type() != InputTypeNames::password) { |
313 data.selectedText = selectedFrame->selectedText().stripWhiteSpace(); | 314 data.selectedText = selectedFrame->selectedText().stripWhiteSpace(); |
314 } | 315 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 subMenuItems.swap(outputItems); | 452 subMenuItems.swap(outputItems); |
452 } | 453 } |
453 | 454 |
454 void ContextMenuClientImpl::populateCustomMenuItems( | 455 void ContextMenuClientImpl::populateCustomMenuItems( |
455 const ContextMenu* defaultMenu, | 456 const ContextMenu* defaultMenu, |
456 WebContextMenuData* data) { | 457 WebContextMenuData* data) { |
457 populateSubMenuItems(defaultMenu->items(), data->customItems); | 458 populateSubMenuItems(defaultMenu->items(), data->customItems); |
458 } | 459 } |
459 | 460 |
460 } // namespace blink | 461 } // namespace blink |
OLD | NEW |