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

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

Issue 22417002: Rename ASSERT_NO_EXCEPTION_STATE and IGNORE_EXCEPTION_STATE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | « Source/web/ApplicationCacheHost.cpp ('k') | Source/web/WebFrameImpl.cpp » ('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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return String(); 157 return String();
158 158
159 // Caret and range selections always return valid normalized ranges. 159 // Caret and range selections always return valid normalized ranges.
160 RefPtr<Range> selectionRange = selection.toNormalizedRange(); 160 RefPtr<Range> selectionRange = selection.toNormalizedRange();
161 Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->mark ersInRange(selectionRange.get(), DocumentMarker::Spelling | DocumentMarker::Gram mar); 161 Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->mark ersInRange(selectionRange.get(), DocumentMarker::Spelling | DocumentMarker::Gram mar);
162 if (markers.size() != 1) 162 if (markers.size() != 1)
163 return String(); 163 return String();
164 marker = *markers[0]; 164 marker = *markers[0];
165 165
166 // Cloning a range fails only for invalid ranges. 166 // Cloning a range fails only for invalid ranges.
167 RefPtr<Range> markerRange = selectionRange->cloneRange(ASSERT_NO_EXCEPTION_S TATE); 167 RefPtr<Range> markerRange = selectionRange->cloneRange(ASSERT_NO_EXCEPTION);
168 markerRange->setStart(markerRange->startContainer(), marker.startOffset()); 168 markerRange->setStart(markerRange->startContainer(), marker.startOffset());
169 markerRange->setEnd(markerRange->endContainer(), marker.endOffset()); 169 markerRange->setEnd(markerRange->endContainer(), marker.endOffset());
170 170
171 if (markerRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation) != selec tionRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation)) 171 if (markerRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation) != selec tionRange->text().stripWhiteSpace(&IsWhiteSpaceOrPunctuation))
172 return String(); 172 return String();
173 173
174 return markerRange->text(); 174 return markerRange->text();
175 } 175 }
176 176
177 void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM enu) 177 void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM enu)
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 outputItems[i] = subItems[i]; 404 outputItems[i] = subItems[i];
405 subMenuItems.swap(outputItems); 405 subMenuItems.swap(outputItems);
406 } 406 }
407 407
408 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data) 408 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data)
409 { 409 {
410 populateSubMenuItems(defaultMenu->items(), data->customItems); 410 populateSubMenuItems(defaultMenu->items(), data->customItems);
411 } 411 }
412 412
413 } // namespace WebKit 413 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/ApplicationCacheHost.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698