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

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

Issue 2930433004: Send UMA recording state to TranslateRanker. (Closed)
Patch Set: Enable Logging in tests that use Flushing. Created 3 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 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_IMPL_H_ 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_IMPL_H_
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_IMPL_H_ 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ~TranslateRankerImpl() override; 83 ~TranslateRankerImpl() override;
84 84
85 // Get the file path of the translate ranker model, by default with a fixed 85 // Get the file path of the translate ranker model, by default with a fixed
86 // name within |data_dir|. 86 // name within |data_dir|.
87 static base::FilePath GetModelPath(const base::FilePath& data_dir); 87 static base::FilePath GetModelPath(const base::FilePath& data_dir);
88 88
89 // Get the URL from which the download the translate ranker model, by default 89 // Get the URL from which the download the translate ranker model, by default
90 // from Finch. 90 // from Finch.
91 static GURL GetModelURL(); 91 static GURL GetModelURL();
92 92
93 // Override the default enabled/disabled state of translate event logging.
94 void EnableLogging(bool value);
95
96 // TranslateRanker... 93 // TranslateRanker...
94 void EnableLogging(bool value) override;
97 uint32_t GetModelVersion() const override; 95 uint32_t GetModelVersion() const override;
98 bool ShouldOfferTranslation( 96 bool ShouldOfferTranslation(
99 metrics::TranslateEventProto* translate_event) override; 97 metrics::TranslateEventProto* translate_event) override;
100 void FlushTranslateEvents( 98 void FlushTranslateEvents(
101 std::vector<metrics::TranslateEventProto>* events) override; 99 std::vector<metrics::TranslateEventProto>* events) override;
102 void RecordTranslateEvent( 100 void RecordTranslateEvent(
103 int event_type, 101 int event_type,
104 const GURL& url, 102 const GURL& url,
105 metrics::TranslateEventProto* translate_event) override; 103 metrics::TranslateEventProto* translate_event) override;
106 bool ShouldOverrideDecision( 104 bool ShouldOverrideDecision(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 158
161 DISALLOW_COPY_AND_ASSIGN(TranslateRankerImpl); 159 DISALLOW_COPY_AND_ASSIGN(TranslateRankerImpl);
162 }; 160 };
163 161
164 } // namespace translate 162 } // namespace translate
165 163
166 std::ostream& operator<<(std::ostream& stream, 164 std::ostream& operator<<(std::ostream& stream,
167 const translate::TranslateRankerFeatures& features); 165 const translate::TranslateRankerFeatures& features);
168 166
169 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_IMPL_H_ 167 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_IMPL_H_
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_ranker.h ('k') | components/translate/core/browser/translate_ranker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698