| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 if (ws.url().isValid()) | 323 if (ws.url().isValid()) |
| 324 data.keywordURL = ws.url(); | 324 data.keywordURL = ws.url(); |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 | 327 |
| 328 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") !
= FalseTriState) | 328 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") !
= FalseTriState) |
| 329 data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuIte
mChecked; | 329 data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuIte
mChecked; |
| 330 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") !
= FalseTriState) | 330 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") !
= FalseTriState) |
| 331 data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuIte
mChecked; | 331 data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuIte
mChecked; |
| 332 | 332 |
| 333 // Now retrieve the security info. | |
| 334 DocumentLoader* dl = selectedFrame->loader().documentLoader(); | |
| 335 WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl); | |
| 336 if (ds) | |
| 337 data.securityInfo = ds->response().securityInfo(); | |
| 338 | |
| 339 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document
()->getReferrerPolicy()); | 333 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document
()->getReferrerPolicy()); |
| 340 | 334 |
| 341 // Filter out custom menu elements and add them into the data. | 335 // Filter out custom menu elements and add them into the data. |
| 342 populateCustomMenuItems(defaultMenu, &data); | 336 populateCustomMenuItems(defaultMenu, &data); |
| 343 | 337 |
| 344 if (isHTMLAnchorElement(r.URLElement())) { | 338 if (isHTMLAnchorElement(r.URLElement())) { |
| 345 HTMLAnchorElement* anchor = toHTMLAnchorElement(r.URLElement()); | 339 HTMLAnchorElement* anchor = toHTMLAnchorElement(r.URLElement()); |
| 346 | 340 |
| 347 // Extract suggested filename for saving file. | 341 // Extract suggested filename for saving file. |
| 348 data.suggestedFilename = anchor->fastGetAttribute(HTMLNames::downloadAtt
r); | 342 data.suggestedFilename = anchor->fastGetAttribute(HTMLNames::downloadAtt
r); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 outputItems[i] = subItems[i]; | 421 outputItems[i] = subItems[i]; |
| 428 subMenuItems.swap(outputItems); | 422 subMenuItems.swap(outputItems); |
| 429 } | 423 } |
| 430 | 424 |
| 431 void ContextMenuClientImpl::populateCustomMenuItems(const ContextMenu* defaultMe
nu, WebContextMenuData* data) | 425 void ContextMenuClientImpl::populateCustomMenuItems(const ContextMenu* defaultMe
nu, WebContextMenuData* data) |
| 432 { | 426 { |
| 433 populateSubMenuItems(defaultMenu->items(), data->customItems); | 427 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 434 } | 428 } |
| 435 | 429 |
| 436 } // namespace blink | 430 } // namespace blink |
| OLD | NEW |