| OLD | NEW |
| 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 Loading... |
| 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; |
| 178 else if (equalIgnoringCase(markerType, "TextMatch")) | 180 else if (equalIgnoringCase(markerType, "TextMatch")) |
| 179 result = DocumentMarker::TextMatch; | 181 result = DocumentMarker::TextMatch; |
| 180 else | 182 else |
| 181 return false; | 183 return false; |
| 182 | 184 |
| 183 return true; | 185 return true; |
| 184 } | 186 } |
| 185 | 187 |
| 186 static SpellCheckRequester* spellCheckRequester(Document* document) | 188 static SpellCheckRequester* spellCheckRequester(Document* document) |
| 187 { | 189 { |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 Vector<unsigned long> Internals::setMemoryCacheCapacities(unsigned long minDeadB
ytes, unsigned long maxDeadBytes, unsigned long totalBytes) | 1605 Vector<unsigned long> Internals::setMemoryCacheCapacities(unsigned long minDeadB
ytes, unsigned long maxDeadBytes, unsigned long totalBytes) |
| 1604 { | 1606 { |
| 1605 Vector<unsigned long> result; | 1607 Vector<unsigned long> result; |
| 1606 result.append(memoryCache()->minDeadCapacity()); | 1608 result.append(memoryCache()->minDeadCapacity()); |
| 1607 result.append(memoryCache()->maxDeadCapacity()); | 1609 result.append(memoryCache()->maxDeadCapacity()); |
| 1608 result.append(memoryCache()->capacity()); | 1610 result.append(memoryCache()->capacity()); |
| 1609 memoryCache()->setCapacities(minDeadBytes, maxDeadBytes, totalBytes); | 1611 memoryCache()->setCapacities(minDeadBytes, maxDeadBytes, totalBytes); |
| 1610 return result; | 1612 return result; |
| 1611 } | 1613 } |
| 1612 | 1614 |
| 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 |
| 1613 unsigned Internals::numberOfScrollableAreas(Document* document) | 1624 unsigned Internals::numberOfScrollableAreas(Document* document) |
| 1614 { | 1625 { |
| 1615 ASSERT(document); | 1626 ASSERT(document); |
| 1616 if (!document->frame()) | 1627 if (!document->frame()) |
| 1617 return 0; | 1628 return 0; |
| 1618 | 1629 |
| 1619 unsigned count = 0; | 1630 unsigned count = 0; |
| 1620 LocalFrame* frame = document->frame(); | 1631 LocalFrame* frame = document->frame(); |
| 1621 if (frame->view()->scrollableAreas()) | 1632 if (frame->view()->scrollableAreas()) |
| 1622 count += frame->view()->scrollableAreas()->size(); | 1633 count += frame->view()->scrollableAreas()->size(); |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2602 } | 2613 } |
| 2603 | 2614 |
| 2604 String Internals::getProgrammaticScrollAnimationState(Node* node) const | 2615 String Internals::getProgrammaticScrollAnimationState(Node* node) const |
| 2605 { | 2616 { |
| 2606 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) | 2617 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) |
| 2607 return scrollableArea->programmaticScrollAnimator().runStateAsText(); | 2618 return scrollableArea->programmaticScrollAnimator().runStateAsText(); |
| 2608 return String(); | 2619 return String(); |
| 2609 } | 2620 } |
| 2610 | 2621 |
| 2611 } // namespace blink | 2622 } // namespace blink |
| OLD | NEW |