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

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

Issue 23618052: TextBreakIterator should use the C++ icu API instead of the C one (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Proposed patch v4 Created 7 years, 2 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
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return ds->hasUnreachableURL() ? ds->unreachableURL() : ds->requ est().url(); 93 return ds->hasUnreachableURL() ? ds->unreachableURL() : ds->requ est().url();
94 } 94 }
95 } 95 }
96 return WebURL(); 96 return WebURL();
97 } 97 }
98 98
99 // Helper function to determine whether text is a single word. 99 // Helper function to determine whether text is a single word.
100 static bool isASingleWord(const String& text) 100 static bool isASingleWord(const String& text)
101 { 101 {
102 TextBreakIterator* it = wordBreakIterator(text, 0, text.length()); 102 TextBreakIterator* it = wordBreakIterator(text, 0, text.length());
103 return it && textBreakNext(it) == static_cast<int>(text.length()); 103 return it && it->next() == static_cast<int>(text.length());
104 } 104 }
105 105
106 // Helper function to get misspelled word on which context menu 106 // Helper function to get misspelled word on which context menu
107 // is to be invoked. This function also sets the word on which context menu 107 // is to be invoked. This function also sets the word on which context menu
108 // has been invoked to be the selected word, as required. This function changes 108 // has been invoked to be the selected word, as required. This function changes
109 // the selection only when there were no selected characters on OS X. 109 // the selection only when there were no selected characters on OS X.
110 static String selectMisspelledWord(Frame* selectedFrame) 110 static String selectMisspelledWord(Frame* selectedFrame)
111 { 111 {
112 // First select from selectedText to check for multiple word selection. 112 // First select from selectedText to check for multiple word selection.
113 String misspelledWord = selectedFrame->selectedText().stripWhiteSpace(); 113 String misspelledWord = selectedFrame->selectedText().stripWhiteSpace();
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 outputItems[i] = subItems[i]; 412 outputItems[i] = subItems[i];
413 subMenuItems.swap(outputItems); 413 subMenuItems.swap(outputItems);
414 } 414 }
415 415
416 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data) 416 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data)
417 { 417 {
418 populateSubMenuItems(defaultMenu->items(), data->customItems); 418 populateSubMenuItems(defaultMenu->items(), data->customItems);
419 } 419 }
420 420
421 } // namespace WebKit 421 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698