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

Side by Side Diff: chrome/browser/spellchecker/misspelling.h

Issue 1665023002: Cheer up spell-checking code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More descriptive variable name Created 4 years, 10 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 <vector> 18 #include <vector>
19 19
20 #include "base/memory/scoped_ptr.h"
20 #include "base/time/time.h" 21 #include "base/time/time.h"
21 #include "chrome/browser/spellchecker/spellcheck_action.h" 22 #include "chrome/browser/spellchecker/spellcheck_action.h"
22 23
23 // Stores user feedback to a spellcheck suggestion. Sample usage: 24 // Stores user feedback to a spellcheck suggestion. Sample usage:
24 // Misspelling misspelling. 25 // Misspelling misspelling.
25 // misspelling.context = base::ASCIIToUTF16("Helllo world"); 26 // misspelling.context = base::ASCIIToUTF16("Helllo world");
26 // misspelling.location = 0; 27 // misspelling.location = 0;
27 // misspelling.length = 6; 28 // misspelling.length = 6;
28 // misspelling.suggestions = 29 // misspelling.suggestions =
29 // std::vector<base::string16>(1, base::ASCIIToUTF16("Hello")); 30 // std::vector<base::string16>(1, base::ASCIIToUTF16("Hello"));
(...skipping 26 matching lines...) Expand all
56 // The hash that identifies the misspelling. 57 // The hash that identifies the misspelling.
57 uint32_t hash; 58 uint32_t hash;
58 59
59 // User action. 60 // User action.
60 SpellcheckAction action; 61 SpellcheckAction action;
61 62
62 // The time when the user applied the action. 63 // The time when the user applied the action.
63 base::Time timestamp; 64 base::Time timestamp;
64 }; 65 };
65 66
66 // Serializes the data in this object into a dictionary value. The caller owns 67 // Serializes the data in this object into a dictionary value.
67 // the result. 68 scoped_ptr<base::DictionaryValue> SerializeMisspelling(
68 base::DictionaryValue* SerializeMisspelling(const Misspelling& misspelling); 69 const Misspelling& misspelling);
69 70
70 // Returns the substring of |context| that begins at |location| and contains 71 // Returns the substring of |context| that begins at |location| and contains
71 // |length| characters. 72 // |length| characters.
72 base::string16 GetMisspelledString(const Misspelling& misspelling); 73 base::string16 GetMisspelledString(const Misspelling& misspelling);
73 74
74 // Returns the approximate size of the misspelling when serialized. 75 // Returns the approximate size of the misspelling when serialized.
75 size_t ApproximateSerializedSize(const Misspelling& misspelling); 76 size_t ApproximateSerializedSize(const Misspelling& misspelling);
76 77
77 #endif // CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ 78 #endif // CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/feedback_sender_unittest.cc ('k') | chrome/browser/spellchecker/misspelling.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698