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

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

Issue 2697703004: Allow TranslateRanker to override decisions taken by heuristics. (Closed)
Patch Set: Remove unused include. Created 3 years, 9 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 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 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 28
29 // Returns true if translate events logging is enabled. 29 // Returns true if translate events logging is enabled.
30 virtual bool IsLoggingEnabled() = 0; 30 virtual bool IsLoggingEnabled() = 0;
31 31
32 // Returns true if enforcement is enabled. 32 // Returns true if enforcement is enabled.
33 virtual bool IsEnforcementEnabled() = 0; 33 virtual bool IsEnforcementEnabled() = 0;
34 34
35 // Returns true if querying is enabled. 35 // Returns true if querying is enabled.
36 virtual bool IsQueryEnabled() = 0; 36 virtual bool IsQueryEnabled() = 0;
37 37
38 // Returns true if heuristic decisions should be overriden.
39 virtual bool IsDecisionOverrideEnabled() = 0;
40
38 // Returns the version id for the ranker model. 41 // Returns the version id for the ranker model.
39 virtual int GetModelVersion() const = 0; 42 virtual int GetModelVersion() const = 0;
40 43
41 // Returns true if executing the ranker model in the translation prompt 44 // Returns true if executing the ranker model in the translation prompt
42 // context described by |translate_prefs|, |src_lang|, |dst_lang| and possibly 45 // context described by |translate_prefs|, |src_lang|, |dst_lang| and possibly
43 // other global browser context attributes suggests that the user should be 46 // other global browser context attributes suggests that the user should be
44 // prompted as to whether translation should be performed. 47 // prompted as to whether translation should be performed.
45 virtual bool ShouldOfferTranslation(const TranslatePrefs& translate_prefs, 48 virtual bool ShouldOfferTranslation(const TranslatePrefs& translate_prefs,
46 const std::string& src_lang, 49 const std::string& src_lang,
47 const std::string& dst_lang) = 0; 50 const std::string& dst_lang) = 0;
48 51
49 // Caches the translate event. 52 // Caches the translate event.
50 virtual void AddTranslateEvent( 53 virtual void AddTranslateEvent(
51 const metrics::TranslateEventProto& translate_event) = 0; 54 const metrics::TranslateEventProto& translate_event) = 0;
52 55
53 // Transfers cached translate events to the given vector pointer and clears 56 // Transfers cached translate events to the given vector pointer and clears
54 // the cache. 57 // the cache.
55 virtual void FlushTranslateEvents( 58 virtual void FlushTranslateEvents(
56 std::vector<metrics::TranslateEventProto>* events) = 0; 59 std::vector<metrics::TranslateEventProto>* events) = 0;
57 60
58 private: 61 private:
59 DISALLOW_COPY_AND_ASSIGN(TranslateRanker); 62 DISALLOW_COPY_AND_ASSIGN(TranslateRanker);
60 }; 63 };
61 64
62 } // namespace translate 65 } // namespace translate
63 66
64 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ 67 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698