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

Side by Side Diff: components/translate/core/browser/translate_ranker.h

Issue 2400503002: [Translate] Integrate TranslateEventProto UMA logging into TranslateManager. (Closed)
Patch Set: fix trybots Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 class TranslateRanker { 37 class TranslateRanker {
38 public: 38 public:
39 ~TranslateRanker(); 39 ~TranslateRanker();
40 40
41 // Returns true if query or enforcement is enabled. 41 // Returns true if query or enforcement is enabled.
42 static bool IsEnabled(); 42 static bool IsEnabled();
43 43
44 // Returns true if translate events logging is enabled. 44 // Returns true if translate events logging is enabled.
45 static bool IsLoggingEnabled(); 45 static bool IsLoggingEnabled();
46 46
47 // Returns true if querying is enabled.
48 static bool IsQueryEnabled();
49
50 // Returns true if enforcement is enabled.
51 static bool IsEnforcementEnabled();
52
47 // Returns the singleton TranslateRanker instance. 53 // Returns the singleton TranslateRanker instance.
48 static TranslateRanker* GetInstance(); 54 static TranslateRanker* GetInstance();
49 55
50 // For testing only. Returns a TranslateRanker instance preloaded with a 56 // For testing only. Returns a TranslateRanker instance preloaded with a
51 // TranslateRankerModel as defined by |model_data|. 57 // TranslateRankerModel as defined by |model_data|.
52 static std::unique_ptr<TranslateRanker> CreateForTesting( 58 static std::unique_ptr<TranslateRanker> CreateForTesting(
53 const std::string& model_data); 59 const std::string& model_data);
54 60
55 // Initiates downloading of the assist model data. This is a NOP if the model 61 // Initiates downloading of the assist model data. This is a NOP if the model
56 // data has already been downloaded. 62 // data has already been downloaded.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 FRIEND_TEST_ALL_PREFIXES(TranslateRankerTest, CalculateScore); 120 FRIEND_TEST_ALL_PREFIXES(TranslateRankerTest, CalculateScore);
115 121
116 friend struct base::DefaultSingletonTraits<TranslateRanker>; 122 friend struct base::DefaultSingletonTraits<TranslateRanker>;
117 123
118 DISALLOW_COPY_AND_ASSIGN(TranslateRanker); 124 DISALLOW_COPY_AND_ASSIGN(TranslateRanker);
119 }; 125 };
120 126
121 } // namespace translate 127 } // namespace translate
122 128
123 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ 129 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_manager.cc ('k') | components/translate/core/browser/translate_ranker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698