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

Side by Side Diff: components/spellcheck/browser/misspelling.h

Issue 2159283003: [WIP][DO NOT LAND] Componentize spellcheck Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // An object to store user feedback to a single spellcheck suggestion. 5 // An object to store user feedback to a single spellcheck suggestion.
6 // 6 //
7 // Stores the spellcheck suggestion, its uint32_t hash identifier, and user's 7 // Stores the spellcheck suggestion, its uint32_t hash identifier, and user's
8 // feedback. The feedback is indirect, in the sense that we record user's 8 // feedback. The feedback is indirect, in the sense that we record user's
9 // |action| instead of asking them how they feel about a spellcheck suggestion. 9 // |action| instead of asking them how they feel about a spellcheck suggestion.
10 // The object can serialize itself. 10 // The object can serialize itself.
11 11
12 #ifndef CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ 12 #ifndef CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_
13 #define CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ 13 #define CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_
14 14
15 #include <stddef.h> 15 #include <stddef.h>
16 #include <stdint.h> 16 #include <stdint.h>
17 17
18 #include <memory> 18 #include <memory>
19 #include <vector> 19 #include <vector>
20 20
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "chrome/browser/spellchecker/spellcheck_action.h" 22 #include "components/spellcheck/browser/spellcheck_action.h"
23 23
24 // Stores user feedback to a spellcheck suggestion. Sample usage: 24 // Stores user feedback to a spellcheck suggestion. Sample usage:
25 // Misspelling misspelling. 25 // Misspelling misspelling.
26 // misspelling.context = base::ASCIIToUTF16("Helllo world"); 26 // misspelling.context = base::ASCIIToUTF16("Helllo world");
27 // misspelling.location = 0; 27 // misspelling.location = 0;
28 // misspelling.length = 6; 28 // misspelling.length = 6;
29 // misspelling.suggestions = 29 // misspelling.suggestions =
30 // std::vector<base::string16>(1, base::ASCIIToUTF16("Hello")); 30 // std::vector<base::string16>(1, base::ASCIIToUTF16("Hello"));
31 // misspelling.hash = GenerateRandomHash(); 31 // misspelling.hash = GenerateRandomHash();
32 // misspelling.action.set_type(SpellcheckAction::TYPE_SELECT); 32 // misspelling.action.set_type(SpellcheckAction::TYPE_SELECT);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const Misspelling& misspelling); 70 const Misspelling& misspelling);
71 71
72 // Returns the substring of |context| that begins at |location| and contains 72 // Returns the substring of |context| that begins at |location| and contains
73 // |length| characters. 73 // |length| characters.
74 base::string16 GetMisspelledString(const Misspelling& misspelling); 74 base::string16 GetMisspelledString(const Misspelling& misspelling);
75 75
76 // Returns the approximate size of the misspelling when serialized. 76 // Returns the approximate size of the misspelling when serialized.
77 size_t ApproximateSerializedSize(const Misspelling& misspelling); 77 size_t ApproximateSerializedSize(const Misspelling& misspelling);
78 78
79 #endif // CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ 79 #endif // CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_
OLDNEW
« no previous file with comments | « components/spellcheck/browser/feedback_unittest.cc ('k') | components/spellcheck/browser/misspelling.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698