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

Side by Side Diff: Source/core/editing/SpellChecker.h

Issue 21130005: Trigger spell check/remove markers if spell checker gets enabled/disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improvement & test for chunked spell checking. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class Frame; 41 class Frame;
42 class Node; 42 class Node;
43 class TextCheckerClient; 43 class TextCheckerClient;
44 class SpellChecker; 44 class SpellChecker;
45 45
46 class SpellCheckRequest : public TextCheckingRequest { 46 class SpellCheckRequest : public TextCheckingRequest {
47 public: 47 public:
48 static PassRefPtr<SpellCheckRequest> create(TextCheckingTypeMask, TextChecki ngProcessType, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange ); 48 static PassRefPtr<SpellCheckRequest> create(TextCheckingTypeMask, TextChecki ngProcessType, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange , int requestNumber = 0);
49 virtual ~SpellCheckRequest(); 49 virtual ~SpellCheckRequest();
50 50
51 PassRefPtr<Range> checkingRange() const { return m_checkingRange; } 51 PassRefPtr<Range> checkingRange() const { return m_checkingRange; }
52 PassRefPtr<Range> paragraphRange() const { return m_paragraphRange; } 52 PassRefPtr<Range> paragraphRange() const { return m_paragraphRange; }
53 PassRefPtr<Element> rootEditableElement() const { return m_rootEditableEleme nt; } 53 PassRefPtr<Element> rootEditableElement() const { return m_rootEditableEleme nt; }
54 54
55 void setCheckerAndSequence(SpellChecker*, int sequence); 55 void setCheckerAndSequence(SpellChecker*, int sequence);
56 void requesterDestroyed(); 56 void requesterDestroyed();
57 bool isStarted() const { return m_checker; } 57 bool isStarted() const { return m_checker; }
58 58
59 virtual const TextCheckingRequestData& data() const OVERRIDE; 59 virtual const TextCheckingRequestData& data() const OVERRIDE;
60 virtual void didSucceed(const Vector<TextCheckingResult>&) OVERRIDE; 60 virtual void didSucceed(const Vector<TextCheckingResult>&) OVERRIDE;
61 virtual void didCancel() OVERRIDE; 61 virtual void didCancel() OVERRIDE;
62 62
63 int requestNumber() { return m_requestNumber; }
please use gerrit instead 2013/08/13 21:54:21 Nit: Please add a "const" keyword after the method
64
63 private: 65 private:
64 SpellCheckRequest(PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragra phRange, const String&, TextCheckingTypeMask, TextCheckingProcessType, const Vec tor<uint32_t>& documentMarkersInRange, const Vector<unsigned>& documentMarkerOff sets); 66 SpellCheckRequest(PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragra phRange, const String&, TextCheckingTypeMask, TextCheckingProcessType, const Vec tor<uint32_t>& documentMarkersInRange, const Vector<unsigned>& documentMarkerOff sets, int requestNo);
please use gerrit instead 2013/08/13 21:54:21 Nit: Please be consistent in naming: s/requestNo/r
65 67
66 SpellChecker* m_checker; 68 SpellChecker* m_checker;
67 RefPtr<Range> m_checkingRange; 69 RefPtr<Range> m_checkingRange;
68 RefPtr<Range> m_paragraphRange; 70 RefPtr<Range> m_paragraphRange;
69 RefPtr<Element> m_rootEditableElement; 71 RefPtr<Element> m_rootEditableElement;
70 TextCheckingRequestData m_requestData; 72 TextCheckingRequestData m_requestData;
73 int m_requestNumber;
71 }; 74 };
72 75
73 class SpellChecker { 76 class SpellChecker {
74 WTF_MAKE_NONCOPYABLE(SpellChecker); WTF_MAKE_FAST_ALLOCATED; 77 WTF_MAKE_NONCOPYABLE(SpellChecker); WTF_MAKE_FAST_ALLOCATED;
75 public: 78 public:
76 friend class SpellCheckRequest; 79 friend class SpellCheckRequest;
77 80
78 explicit SpellChecker(Frame*); 81 explicit SpellChecker(Frame*);
79 ~SpellChecker(); 82 ~SpellChecker();
80 83
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 115
113 Timer<SpellChecker> m_timerToProcessQueuedRequest; 116 Timer<SpellChecker> m_timerToProcessQueuedRequest;
114 117
115 RefPtr<SpellCheckRequest> m_processingRequest; 118 RefPtr<SpellCheckRequest> m_processingRequest;
116 RequestQueue m_requestQueue; 119 RequestQueue m_requestQueue;
117 }; 120 };
118 121
119 } // namespace WebCore 122 } // namespace WebCore
120 123
121 #endif // SpellChecker_h 124 #endif // SpellChecker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698