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

Side by Side Diff: third_party/WebKit/WebCore/platform/ContextMenu.cpp

Issue 21184: WebKit merge 40722:40785 (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « third_party/WebKit/WebCore/page/Frame.cpp ('k') | third_party/WebKit/WebCore/platform/KURL.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) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Christian Dywan <christian@imendio.com> 3 * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 textDirectionMenu.appendItem(ltr); 185 textDirectionMenu.appendItem(ltr);
186 textDirectionMenu.appendItem(rtl); 186 textDirectionMenu.appendItem(rtl);
187 187
188 textDirectionMenuItem.setSubMenu(&textDirectionMenu); 188 textDirectionMenuItem.setSubMenu(&textDirectionMenu);
189 } 189 }
190 #endif 190 #endif
191 191
192 static bool selectionContainsPossibleWord(Frame* frame) 192 static bool selectionContainsPossibleWord(Frame* frame)
193 { 193 {
194 // Current algorithm: look for a character that's not just a separator. 194 // Current algorithm: look for a character that's not just a separator.
195 for (TextIterator it(frame->selection()->toRange().get()); !it.atEnd(); it.a dvance()) { 195 for (TextIterator it(frame->selection()->toNormalizedRange().get()); !it.atE nd(); it.advance()) {
196 int length = it.length(); 196 int length = it.length();
197 const UChar* characters = it.characters(); 197 const UChar* characters = it.characters();
198 for (int i = 0; i < length; ++i) 198 for (int i = 0; i < length; ++i)
199 if (!(category(characters[i]) & (Separator_Space | Separator_Line | Separator_Paragraph))) 199 if (!(category(characters[i]) & (Separator_Space | Separator_Line | Separator_Paragraph)))
200 return true; 200 return true;
201 } 201 }
202 return false; 202 return false;
203 } 203 }
204 204
205 void ContextMenu::populate() 205 void ContextMenu::populate()
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 case ContextMenuItemBaseApplicationTag: 648 case ContextMenuItemBaseApplicationTag:
649 break; 649 break;
650 } 650 }
651 651
652 item.setChecked(shouldCheck); 652 item.setChecked(shouldCheck);
653 item.setEnabled(shouldEnable); 653 item.setEnabled(shouldEnable);
654 } 654 }
655 655
656 } 656 }
657 657
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/page/Frame.cpp ('k') | third_party/WebKit/WebCore/platform/KURL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698