| OLD | NEW |
| 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 hash identifier, and user's | 7 // Stores the spellcheck suggestion, its uint32 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 <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/spellchecker/spellcheck_action.h" | 18 #include "chrome/browser/spellchecker/spellcheck_action.h" |
| 19 | 19 |
| 20 // Stores user feedback to a spellcheck suggestion. Sample usage: | 20 // Stores user feedback to a spellcheck suggestion. Sample usage: |
| 21 // Misspelling misspelling. | 21 // Misspelling misspelling. |
| 22 // misspelling.context = ASCIIToUTF16("Helllo world"); | 22 // misspelling.context = base::ASCIIToUTF16("Helllo world"); |
| 23 // misspelling.location = 0; | 23 // misspelling.location = 0; |
| 24 // misspelling.length = 6; | 24 // misspelling.length = 6; |
| 25 // misspelling.suggestions = | 25 // misspelling.suggestions = |
| 26 // std::vector<base::string16>(1, ASCIIToUTF16("Hello")); | 26 // std::vector<base::string16>(1, base::ASCIIToUTF16("Hello")); |
| 27 // misspelling.hash = GenerateRandomHash(); | 27 // misspelling.hash = GenerateRandomHash(); |
| 28 // misspelling.action.type = SpellcheckAction::TYPE_SELECT; | 28 // misspelling.action.type = SpellcheckAction::TYPE_SELECT; |
| 29 // misspelling.action.index = 0; | 29 // misspelling.action.index = 0; |
| 30 // Process(misspelling.Serialize()); | 30 // Process(misspelling.Serialize()); |
| 31 class Misspelling { | 31 class Misspelling { |
| 32 public: | 32 public: |
| 33 Misspelling(); | 33 Misspelling(); |
| 34 Misspelling(const base::string16& context, | 34 Misspelling(const base::string16& context, |
| 35 size_t location, | 35 size_t location, |
| 36 size_t length, | 36 size_t length, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 63 uint32 hash; | 63 uint32 hash; |
| 64 | 64 |
| 65 // User action. | 65 // User action. |
| 66 SpellcheckAction action; | 66 SpellcheckAction action; |
| 67 | 67 |
| 68 // The time when the user applied the action. | 68 // The time when the user applied the action. |
| 69 base::Time timestamp; | 69 base::Time timestamp; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 #endif // CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ | 72 #endif // CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ |
| OLD | NEW |