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

Side by Side Diff: third_party/WebKit/Source/platform/text/TextChecking.h

Issue 2848943002: Allow storing multiple replacements on SpellCheckResult (Closed)
Patch Set: Rebase Created 3 years, 6 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) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 Vector<String> guesses; 46 Vector<String> guesses;
47 String user_description; 47 String user_description;
48 }; 48 };
49 49
50 struct TextCheckingResult { 50 struct TextCheckingResult {
51 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 51 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
52 TextDecorationType decoration; 52 TextDecorationType decoration;
53 int location; 53 int location;
54 int length; 54 int length;
55 Vector<GrammarDetail> details; 55 Vector<GrammarDetail> details;
56 String replacement; 56 Vector<String> replacements;
57 }; 57 };
58 58
59 const int kUnrequestedTextCheckingSequence = -1; 59 const int kUnrequestedTextCheckingSequence = -1;
60 60
61 class TextCheckingRequestData final { 61 class TextCheckingRequestData final {
62 DISALLOW_NEW(); 62 DISALLOW_NEW();
63 public: 63 public:
64 TextCheckingRequestData(const String& text) 64 TextCheckingRequestData(const String& text)
65 : sequence_(kUnrequestedTextCheckingSequence), text_(text) {} 65 : sequence_(kUnrequestedTextCheckingSequence), text_(text) {}
66 66
67 void SetSequence(int sequence) { sequence_ = sequence; } 67 void SetSequence(int sequence) { sequence_ = sequence; }
68 int Sequence() const { return sequence_; } 68 int Sequence() const { return sequence_; }
69 String GetText() const { return text_; } 69 String GetText() const { return text_; }
70 70
71 private: 71 private:
72 int sequence_; 72 int sequence_;
73 String text_; 73 String text_;
74 }; 74 };
75 75
76 class TextCheckingRequest 76 class PLATFORM_EXPORT TextCheckingRequest
77 : public GarbageCollectedFinalized<TextCheckingRequest> { 77 : public GarbageCollectedFinalized<TextCheckingRequest> {
78 public: 78 public:
79 virtual ~TextCheckingRequest() {} 79 virtual ~TextCheckingRequest() {}
80 DEFINE_INLINE_VIRTUAL_TRACE() {} 80 DEFINE_INLINE_VIRTUAL_TRACE() {}
81 81
82 virtual const TextCheckingRequestData& Data() const = 0; 82 virtual const TextCheckingRequestData& Data() const = 0;
83 virtual void DidSucceed(const Vector<TextCheckingResult>&) = 0; 83 virtual void DidSucceed(const Vector<TextCheckingResult>&) = 0;
84 virtual void DidCancel() = 0; 84 virtual void DidCancel() = 0;
85 }; 85 };
86 86
87 } // namespace blink 87 } // namespace blink
88 88
89 #endif // TextChecking_h 89 #endif // TextChecking_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698