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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2191803002: Remove hasGrammarMarker from internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 }; 168 };
169 169
170 } // namespace 170 } // namespace
171 171
172 static bool markerTypesFrom(const String& markerType, DocumentMarker::MarkerType s& result) 172 static bool markerTypesFrom(const String& markerType, DocumentMarker::MarkerType s& result)
173 { 173 {
174 if (markerType.isEmpty() || equalIgnoringCase(markerType, "all")) 174 if (markerType.isEmpty() || equalIgnoringCase(markerType, "all"))
175 result = DocumentMarker::AllMarkers(); 175 result = DocumentMarker::AllMarkers();
176 else if (equalIgnoringCase(markerType, "Spelling")) 176 else if (equalIgnoringCase(markerType, "Spelling"))
177 result = DocumentMarker::Spelling; 177 result = DocumentMarker::Spelling;
178 else if (equalIgnoringCase(markerType, "Grammar"))
179 result = DocumentMarker::Grammar;
180 else if (equalIgnoringCase(markerType, "TextMatch")) 178 else if (equalIgnoringCase(markerType, "TextMatch"))
181 result = DocumentMarker::TextMatch; 179 result = DocumentMarker::TextMatch;
182 else 180 else
183 return false; 181 return false;
184 182
185 return true; 183 return true;
186 } 184 }
187 185
188 static SpellCheckRequester* spellCheckRequester(Document* document) 186 static SpellCheckRequester* spellCheckRequester(Document* document)
189 { 187 {
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 Vector<unsigned long> Internals::setMemoryCacheCapacities(unsigned long minDeadB ytes, unsigned long maxDeadBytes, unsigned long totalBytes) 1603 Vector<unsigned long> Internals::setMemoryCacheCapacities(unsigned long minDeadB ytes, unsigned long maxDeadBytes, unsigned long totalBytes)
1606 { 1604 {
1607 Vector<unsigned long> result; 1605 Vector<unsigned long> result;
1608 result.append(memoryCache()->minDeadCapacity()); 1606 result.append(memoryCache()->minDeadCapacity());
1609 result.append(memoryCache()->maxDeadCapacity()); 1607 result.append(memoryCache()->maxDeadCapacity());
1610 result.append(memoryCache()->capacity()); 1608 result.append(memoryCache()->capacity());
1611 memoryCache()->setCapacities(minDeadBytes, maxDeadBytes, totalBytes); 1609 memoryCache()->setCapacities(minDeadBytes, maxDeadBytes, totalBytes);
1612 return result; 1610 return result;
1613 } 1611 }
1614 1612
1615 bool Internals::hasGrammarMarker(Document* document, int from, int length)
1616 {
1617 ASSERT(document);
1618 if (!document->frame())
1619 return false;
1620
1621 return document->frame()->spellChecker().selectionStartHasMarkerFor(Document Marker::Grammar, from, length);
1622 }
1623
1624 unsigned Internals::numberOfScrollableAreas(Document* document) 1613 unsigned Internals::numberOfScrollableAreas(Document* document)
1625 { 1614 {
1626 ASSERT(document); 1615 ASSERT(document);
1627 if (!document->frame()) 1616 if (!document->frame())
1628 return 0; 1617 return 0;
1629 1618
1630 unsigned count = 0; 1619 unsigned count = 0;
1631 LocalFrame* frame = document->frame(); 1620 LocalFrame* frame = document->frame();
1632 if (frame->view()->scrollableAreas()) 1621 if (frame->view()->scrollableAreas())
1633 count += frame->view()->scrollableAreas()->size(); 1622 count += frame->view()->scrollableAreas()->size();
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 } 2602 }
2614 2603
2615 String Internals::getProgrammaticScrollAnimationState(Node* node) const 2604 String Internals::getProgrammaticScrollAnimationState(Node* node) const
2616 { 2605 {
2617 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) 2606 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node))
2618 return scrollableArea->programmaticScrollAnimator().runStateAsText(); 2607 return scrollableArea->programmaticScrollAnimator().runStateAsText();
2619 return String(); 2608 return String();
2620 } 2609 }
2621 2610
2622 } // namespace blink 2611 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.h ('k') | third_party/WebKit/Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698