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

Side by Side Diff: chrome/browser/translate/chrome_translate_client.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
« no previous file with comments | « no previous file | chrome/browser/translate/chrome_translate_client.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 18 matching lines...) Expand all
29 class PrefService; 29 class PrefService;
30 30
31 namespace translate { 31 namespace translate {
32 class LanguageModel; 32 class LanguageModel;
33 class LanguageState; 33 class LanguageState;
34 class TranslateAcceptLanguages; 34 class TranslateAcceptLanguages;
35 class TranslatePrefs; 35 class TranslatePrefs;
36 class TranslateManager; 36 class TranslateManager;
37 } // namespace translate 37 } // namespace translate
38 38
39 enum class ShowTranslateBubbleResult;
40
39 class ChromeTranslateClient 41 class ChromeTranslateClient
40 : public translate::TranslateClient, 42 : public translate::TranslateClient,
41 public translate::ContentTranslateDriver::Observer, 43 public translate::ContentTranslateDriver::Observer,
42 public content::WebContentsObserver, 44 public content::WebContentsObserver,
43 public content::WebContentsUserData<ChromeTranslateClient> { 45 public content::WebContentsUserData<ChromeTranslateClient> {
44 public: 46 public:
45 ~ChromeTranslateClient() override; 47 ~ChromeTranslateClient() override;
46 48
47 // Gets the LanguageState associated with the page. 49 // Gets the LanguageState associated with the page.
48 translate::LanguageState& GetLanguageState(); 50 translate::LanguageState& GetLanguageState();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 translate::TranslateErrors::Type error_type) override; 112 translate::TranslateErrors::Type error_type) override;
111 113
112 private: 114 private:
113 explicit ChromeTranslateClient(content::WebContents* web_contents); 115 explicit ChromeTranslateClient(content::WebContents* web_contents);
114 friend class content::WebContentsUserData<ChromeTranslateClient>; 116 friend class content::WebContentsUserData<ChromeTranslateClient>;
115 117
116 // content::WebContentsObserver implementation. 118 // content::WebContentsObserver implementation.
117 void WebContentsDestroyed() override; 119 void WebContentsDestroyed() override;
118 120
119 // Shows the translate bubble. 121 // Shows the translate bubble.
120 void ShowBubble(translate::TranslateStep step, 122 ShowTranslateBubbleResult ShowBubble(
121 translate::TranslateErrors::Type error_type); 123 translate::TranslateStep step,
124 translate::TranslateErrors::Type error_type);
122 125
123 translate::ContentTranslateDriver translate_driver_; 126 translate::ContentTranslateDriver translate_driver_;
124 std::unique_ptr<translate::TranslateManager> translate_manager_; 127 std::unique_ptr<translate::TranslateManager> translate_manager_;
125 128
126 // Model to be notified about detected language of every page visited. Not 129 // Model to be notified about detected language of every page visited. Not
127 // owned here. 130 // owned here.
128 translate::LanguageModel* language_model_; 131 translate::LanguageModel* language_model_;
129 132
130 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient); 133 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient);
131 }; 134 };
132 135
133 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ 136 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/translate/chrome_translate_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698