Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: Source/web/ContextMenuClientImpl.cpp

Issue 66313007: [Blink] Adding Writing direction to the context menu for linux gtk (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | public/web/WebContextMenuData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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) 351 #if OS(MACOSX) || OS(LINUX)
352 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") ! = FalseTriState) 352 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") ! = FalseTriState)
353 data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuIte mChecked; 353 data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuIte mChecked;
354 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") ! = FalseTriState) 354 if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") ! = FalseTriState)
355 data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuIte mChecked; 355 data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuIte mChecked;
356 #endif // OS(MACOSX) 356 #endif // OS(MACOSX) || OS(LINUX)
357 357
358 // Now retrieve the security info. 358 // Now retrieve the security info.
359 DocumentLoader* dl = selectedFrame->loader().documentLoader(); 359 DocumentLoader* dl = selectedFrame->loader().documentLoader();
360 WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl); 360 WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl);
361 if (ds) 361 if (ds)
362 data.securityInfo = ds->response().securityInfo(); 362 data.securityInfo = ds->response().securityInfo();
363 363
364 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document ()->referrerPolicy()); 364 data.referrerPolicy = static_cast<WebReferrerPolicy>(selectedFrame->document ()->referrerPolicy());
365 365
366 // Filter out custom menu elements and add them into the data. 366 // Filter out custom menu elements and add them into the data.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 outputItems[i] = subItems[i]; 415 outputItems[i] = subItems[i];
416 subMenuItems.swap(outputItems); 416 subMenuItems.swap(outputItems);
417 } 417 }
418 418
419 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data) 419 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data)
420 { 420 {
421 populateSubMenuItems(defaultMenu->items(), data->customItems); 421 populateSubMenuItems(defaultMenu->items(), data->customItems);
422 } 422 }
423 423
424 } // namespace blink 424 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | public/web/WebContextMenuData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698