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

Side by Side Diff: chrome/browser/translate/chrome_translate_client.h

Issue 2954053002: Add a unit test for translation event logging. (Closed)
Patch Set: rebase Created 3 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/translate/chrome_translate_client_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ 5 #ifndef CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_
6 #define CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ 6 #define CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 const std::string& translated_lang, 114 const std::string& translated_lang,
115 translate::TranslateErrors::Type error_type) override; 115 translate::TranslateErrors::Type error_type) override;
116 116
117 private: 117 private:
118 explicit ChromeTranslateClient(content::WebContents* web_contents); 118 explicit ChromeTranslateClient(content::WebContents* web_contents);
119 friend class content::WebContentsUserData<ChromeTranslateClient>; 119 friend class content::WebContentsUserData<ChromeTranslateClient>;
120 FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest, 120 FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest,
121 LanguageEventShouldRecord); 121 LanguageEventShouldRecord);
122 FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest, 122 FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest,
123 LanguageEventShouldNotRecord); 123 LanguageEventShouldNotRecord);
124 FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest,
125 TranslationEventShouldRecord);
126 FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest,
127 TranslationEventShouldNotRecord);
124 128
125 // content::WebContentsObserver implementation. 129 // content::WebContentsObserver implementation.
126 void WebContentsDestroyed() override; 130 void WebContentsDestroyed() override;
127 131
128 // Shows the translate bubble. 132 // Shows the translate bubble.
129 ShowTranslateBubbleResult ShowBubble( 133 ShowTranslateBubbleResult ShowBubble(
130 translate::TranslateStep step, 134 translate::TranslateStep step,
131 translate::TranslateErrors::Type error_type); 135 translate::TranslateErrors::Type error_type);
132 136
133 translate::ContentTranslateDriver translate_driver_; 137 translate::ContentTranslateDriver translate_driver_;
134 std::unique_ptr<translate::TranslateManager> translate_manager_; 138 std::unique_ptr<translate::TranslateManager> translate_manager_;
135 139
136 // Model to be notified about detected language of every page visited. Not 140 // Model to be notified about detected language of every page visited. Not
137 // owned here. 141 // owned here.
138 translate::LanguageModel* language_model_; 142 translate::LanguageModel* language_model_;
139 143
140 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient); 144 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient);
141 }; 145 };
142 146
143 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ 147 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/translate/chrome_translate_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698