| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 if (form && r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag)) { | 341 if (form && r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag)) { |
| 342 HTMLInputElement* selectedElement = toHTMLInputElement(r.innerNonSha
redNode()); | 342 HTMLInputElement* selectedElement = toHTMLInputElement(r.innerNonSha
redNode()); |
| 343 if (selectedElement) { | 343 if (selectedElement) { |
| 344 WebSearchableFormData ws = WebSearchableFormData(WebFormElement(
form), WebInputElement(selectedElement)); | 344 WebSearchableFormData ws = WebSearchableFormData(WebFormElement(
form), WebInputElement(selectedElement)); |
| 345 if (ws.url().isValid()) | 345 if (ws.url().isValid()) |
| 346 data.keywordURL = ws.url(); | 346 data.keywordURL = ws.url(); |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 | 350 |
| 351 #if OS(MACOSX) || OS(LINUX) | |
| 352 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") !
= FalseTriState) | 351 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") !
= FalseTriState) |
| 353 data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuIte
mChecked; | 352 data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuIte
mChecked; |
| 354 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") !
= FalseTriState) | 353 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") !
= FalseTriState) |
| 355 data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuIte
mChecked; | 354 data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuIte
mChecked; |
| 356 #endif // OS(MACOSX) || OS(LINUX) | |
| 357 | 355 |
| 358 // Now retrieve the security info. | 356 // Now retrieve the security info. |
| 359 DocumentLoader* dl = selectedFrame->loader().documentLoader(); | 357 DocumentLoader* dl = selectedFrame->loader().documentLoader(); |
| 360 WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl); | 358 WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl); |
| 361 if (ds) | 359 if (ds) |
| 362 data.securityInfo = ds->response().securityInfo(); | 360 data.securityInfo = ds->response().securityInfo(); |
| 363 | 361 |
| 364 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document
()->referrerPolicy()); | 362 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document
()->referrerPolicy()); |
| 365 | 363 |
| 366 // Filter out custom menu elements and add them into the data. | 364 // Filter out custom menu elements and add them into the data. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 outputItems[i] = subItems[i]; | 413 outputItems[i] = subItems[i]; |
| 416 subMenuItems.swap(outputItems); | 414 subMenuItems.swap(outputItems); |
| 417 } | 415 } |
| 418 | 416 |
| 419 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) | 417 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu*
defaultMenu, WebContextMenuData* data) |
| 420 { | 418 { |
| 421 populateSubMenuItems(defaultMenu->items(), data->customItems); | 419 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 422 } | 420 } |
| 423 | 421 |
| 424 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |