| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 if (selectedFrame != m_webView->page()->mainFrame()) { | 298 if (selectedFrame != m_webView->page()->mainFrame()) { |
| 299 data.frameURL = urlFromFrame(selectedFrame); | 299 data.frameURL = urlFromFrame(selectedFrame); |
| 300 HistoryItem* historyItem = selectedFrame->loader().currentItem(); | 300 HistoryItem* historyItem = selectedFrame->loader().currentItem(); |
| 301 if (historyItem) | 301 if (historyItem) |
| 302 data.frameHistoryItem = WebHistoryItem(historyItem); | 302 data.frameHistoryItem = WebHistoryItem(historyItem); |
| 303 } | 303 } |
| 304 | 304 |
| 305 if (r.isSelected()) { | 305 if (r.isSelected()) { |
| 306 if (!isHTMLInputElement(*r.innerNode()) || | 306 if (!isHTMLInputElement(*r.innerNode()) || |
| 307 toHTMLInputElement(r.innerNode())->type() != InputTypeNames::password) | 307 toHTMLInputElement(r.innerNode())->type() != InputTypeNames::password) { |
| 308 // TODO(xiaochengh): Use of updateStyleAndLayoutIgnorePendingStylesheets |
| 309 // needs to be audited. See http://crbug.com/590369 for more details. |
| 310 // Plain text extraction requires clean layout. |
| 311 selectedFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 312 |
| 308 data.selectedText = selectedFrame->selectedText().stripWhiteSpace(); | 313 data.selectedText = selectedFrame->selectedText().stripWhiteSpace(); |
| 314 } |
| 309 } | 315 } |
| 310 | 316 |
| 311 if (r.isContentEditable()) { | 317 if (r.isContentEditable()) { |
| 312 data.isEditable = true; | 318 data.isEditable = true; |
| 313 | 319 |
| 314 // Spellchecker adds spelling markers to misspelled words and attaches | 320 // Spellchecker adds spelling markers to misspelled words and attaches |
| 315 // suggestions to these markers in the background. Therefore, when a | 321 // suggestions to these markers in the background. Therefore, when a |
| 316 // user right-clicks a mouse on a word, Chrome just needs to find a | 322 // user right-clicks a mouse on a word, Chrome just needs to find a |
| 317 // spelling marker on the word instead of spellchecking it. | 323 // spelling marker on the word instead of spellchecking it. |
| 318 String description; | 324 String description; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 subMenuItems.swap(outputItems); | 454 subMenuItems.swap(outputItems); |
| 449 } | 455 } |
| 450 | 456 |
| 451 void ContextMenuClientImpl::populateCustomMenuItems( | 457 void ContextMenuClientImpl::populateCustomMenuItems( |
| 452 const ContextMenu* defaultMenu, | 458 const ContextMenu* defaultMenu, |
| 453 WebContextMenuData* data) { | 459 WebContextMenuData* data) { |
| 454 populateSubMenuItems(defaultMenu->items(), data->customItems); | 460 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 455 } | 461 } |
| 456 | 462 |
| 457 } // namespace blink | 463 } // namespace blink |
| OLD | NEW |