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

Unified Diff: chrome/browser/translate/chrome_translate_client.h

Issue 564743002: Move Translate browser-side IPC handling to the component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/translate/chrome_translate_client.h
diff --git a/chrome/browser/translate/chrome_translate_client.h b/chrome/browser/translate/chrome_translate_client.h
index ed3b9365a825630ad9fa2a162e55e649f1a306f3..a23cbf50a385253793b8b18f8d1edc9749ef4df3 100644
--- a/chrome/browser/translate/chrome_translate_client.h
+++ b/chrome/browser/translate/chrome_translate_client.h
@@ -17,10 +17,6 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
-namespace base {
-class File;
-} // namespace base
-
namespace content {
class BrowserContext;
class WebContents;
@@ -33,7 +29,6 @@ class ScopedCLDDynamicDataHarness;
class PrefService;
namespace translate {
-struct LanguageDetectionDetails;
class LanguageState;
class TranslateAcceptLanguages;
class TranslatePrefs;
@@ -42,6 +37,7 @@ class TranslateManager;
class ChromeTranslateClient
: public translate::TranslateClient,
+ public translate::ContentTranslateDriver::Observer,
public content::WebContentsObserver,
public content::WebContentsUserData<ChromeTranslateClient> {
public:
@@ -100,6 +96,14 @@ class ChromeTranslateClient
virtual void ShowReportLanguageDetectionErrorUI(
const GURL& report_url) OVERRIDE;
+ // TranslateDriver::Observer implementation.
Takashi Toyoshima 2014/09/16 06:32:47 ContentTranslateDriver::Observer?
+ virtual void OnLanguageDetermined(
+ const translate::LanguageDetectionDetails& details) OVERRIDE;
+ virtual void OnPageTranslated(
+ const std::string& original_lang,
+ const std::string& translated_lang,
+ translate::TranslateErrors::Type error_type) OVERRIDE;
+
private:
explicit ChromeTranslateClient(content::WebContents* web_contents);
friend class content::WebContentsUserData<ChromeTranslateClient>;
@@ -108,14 +112,6 @@ class ChromeTranslateClient
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void WebContentsDestroyed() OVERRIDE;
- // IPC handlers.
- void OnTranslateAssignedSequenceNumber(int page_seq_no);
- void OnLanguageDetermined(const translate::LanguageDetectionDetails& details,
- bool page_needs_translation);
- void OnPageTranslated(const std::string& original_lang,
- const std::string& translated_lang,
- translate::TranslateErrors::Type error_type);
-
// Shows the translate bubble.
void ShowBubble(translate::TranslateStep step,
translate::TranslateErrors::Type error_type);

Powered by Google App Engine
This is Rietveld 408576698