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

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

Issue 227043005: Eliminate TranslateManager listening to //chrome-level notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/translate_manager.h
diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h
index fc57637ac2e3cc13f2968ea639ef80bdde862512..665d83dbb9fcfaa81dd94fbb11102bab61fbc555 100644
--- a/chrome/browser/translate/translate_manager.h
+++ b/chrome/browser/translate/translate_manager.h
@@ -13,11 +13,11 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "components/translate/core/common/translate_errors.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
class GURL;
-struct PageTranslatedDetails;
class PrefService;
class TranslateClient;
class TranslateDriver;
@@ -68,6 +68,14 @@ class TranslateManager : public content::NotificationObserver {
const std::string& target_lang,
bool triggered_from_menu);
+ // Starts the translation process for a page in the |page_lang| language.
+ void InitiateTranslation(const std::string& page_lang);
+
+ // Shows the after translate or error infobar depending on the details.
+ void PageTranslated(const std::string& source_lang,
+ const std::string& target_lang,
+ TranslateErrors::Type error_type);
+
// Reverts the contents of the page to its original language.
void RevertTranslation();
@@ -97,8 +105,6 @@ class TranslateManager : public content::NotificationObserver {
RegisterTranslateErrorCallback(const TranslateErrorCallback& callback);
private:
- // Starts the translation process for a page in the |page_lang| language.
- void InitiateTranslation(const std::string& page_lang);
// Initiates translation once the page is finished loading.
void InitiateTranslationPosted(const std::string& page_lang, int attempt);
@@ -108,9 +114,6 @@ class TranslateManager : public content::NotificationObserver {
const std::string& source_lang,
const std::string& target_lang);
- // Shows the after translate or error infobar depending on the details.
- void PageTranslated(PageTranslatedDetails* details);
-
// Called when the Translate script has been fetched.
// Initiates the translation.
void OnTranslateScriptFetchComplete(int page_id,
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager.cc » ('j') | chrome/browser/translate/translate_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698