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