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

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

Issue 1156473007: Enables the user to select multiple languages for spellchecking (UI) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a misleading comment. Created 5 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_
6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DICT_HUNSPELL, 56 DICT_HUNSPELL,
57 DICT_TEXT, 57 DICT_TEXT,
58 DICT_UNKNOWN, 58 DICT_UNKNOWN,
59 }; 59 };
60 60
61 explicit SpellcheckService(content::BrowserContext* context); 61 explicit SpellcheckService(content::BrowserContext* context);
62 ~SpellcheckService() override; 62 ~SpellcheckService() override;
63 63
64 base::WeakPtr<SpellcheckService> GetWeakPtr(); 64 base::WeakPtr<SpellcheckService> GetWeakPtr();
65 65
66 // This function computes a vector of strings which are to be displayed in 66 // Computes |languages| to display in the context menu over a text area for
67 // the context menu over a text area for changing spell check languages. It 67 // changing spellcheck languages. Returns the number of the first spellcheck
68 // returns the index of the current spell check language in the vector. 68 // |languages| that are enabled.
groby-ooo-7-16 2015/06/18 00:44:29 What does "returns the number of the first... that
Julius 2015/06/24 21:17:57 The strings at the beinning of |languages| are cur
69 // TODO(port): this should take a vector of base::string16, but the 69 // TODO(port): this should take a vector of base::string16, but the
70 // implementation has some dependencies in l10n util that need porting first. 70 // implementation has some dependencies in l10n util that need porting first.
71 static int GetSpellCheckLanguages(content::BrowserContext* context, 71 static size_t GetSpellCheckLanguages(content::BrowserContext* context,
72 std::vector<std::string>* languages); 72 std::vector<std::string>* languages);
73
74 // Computes a vector of strings which are to be displayed in the context
75 // menu from |accept_languages| and |dictionary_language|.
76 static void GetSpellCheckLanguagesFromAcceptLanguages(
77 const std::vector<std::string>& accept_languages,
78 const std::string& dictionary_language,
79 std::vector<std::string>* languages);
80 73
81 // Signals the event attached by AttachTestEvent() to report the specified 74 // Signals the event attached by AttachTestEvent() to report the specified
82 // event to browser tests. This function is called by this class and its 75 // event to browser tests. This function is called by this class and its
83 // derived classes to report their status. This function does not do anything 76 // derived classes to report their status. This function does not do anything
84 // when we do not set an event to |status_event_|. 77 // when we do not set an event to |status_event_|.
85 static bool SignalStatusEvent(EventType type); 78 static bool SignalStatusEvent(EventType type);
86 79
87 // Instantiates SpellCheckHostMetrics object and makes it ready for recording 80 // Instantiates SpellCheckHostMetrics object and makes it ready for recording
88 // metrics. This should be called only if the metrics recording is active. 81 // metrics. This should be called only if the metrics recording is active.
89 void StartRecordingMetrics(bool spellcheck_enabled); 82 void StartRecordingMetrics(bool spellcheck_enabled);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 scoped_ptr<SpellcheckHunspellDictionary> hunspell_dictionary_; 165 scoped_ptr<SpellcheckHunspellDictionary> hunspell_dictionary_;
173 166
174 scoped_ptr<spellcheck::FeedbackSender> feedback_sender_; 167 scoped_ptr<spellcheck::FeedbackSender> feedback_sender_;
175 168
176 base::WeakPtrFactory<SpellcheckService> weak_ptr_factory_; 169 base::WeakPtrFactory<SpellcheckService> weak_ptr_factory_;
177 170
178 DISALLOW_COPY_AND_ASSIGN(SpellcheckService); 171 DISALLOW_COPY_AND_ASSIGN(SpellcheckService);
179 }; 172 };
180 173
181 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ 174 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698