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

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

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « chrome/browser/three_d_api_observer.cc ('k') | chrome/browser/translate/translate_infobar_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_infobar_delegate.h
===================================================================
--- chrome/browser/translate/translate_infobar_delegate.h (revision 175396)
+++ chrome/browser/translate/translate_infobar_delegate.h (working copy)
@@ -37,29 +37,29 @@
static const size_t kNoIndex;
- // Factory method to create a non-error translate infobar. |original_language|
- // and |target_language| must be ASCII language codes (e.g. "en", "fr", etc.)
- // for languages the TranslateManager supports translating. The lone exception
- // is when the user initiates translation from the context menu, in which case
- // it's legal to call this with |type| == TRANSLATING and
- // |originalLanguage| == kUnknownLanguageCode.
- static TranslateInfoBarDelegate* CreateDelegate(
- Type infobar_type,
- InfoBarService* infobar_service,
- PrefService* prefs,
- const std::string& original_language,
- const std::string& target_language);
+ virtual ~TranslateInfoBarDelegate();
- // Factory method to create an error translate infobar.
- static TranslateInfoBarDelegate* CreateErrorDelegate(
- TranslateErrors::Type error_type,
- InfoBarService* infobar_service,
- PrefService* prefs,
- const std::string& original_language,
- const std::string& target_language);
+ // Factory method to create a translate infobar. |error_type| must be
+ // specified iff |infobar_type| == TRANSLATION_ERROR. For other infobar
+ // types, |original_language| and |target_language| must be ASCII language
+ // codes (e.g. "en", "fr", etc.) for languages the TranslateManager supports
+ // translating. The lone exception is when the user initiates translation
+ // from the context menu, in which case it's legal to call this with
+ // |infobar_type| == TRANSLATING and
+ // |original_language| == kUnknownLanguageCode.
+ //
+ // If |replace_existing_infobar| is true, the infobar is created and added to
+ // |infobar_service|, replacing any other translate infobar already present
+ // there. Otherwise, the infobar will only be added if there is no other
+ // translate infobar already present.
+ static void Create(InfoBarService* infobar_service,
+ bool replace_existing_infobar,
+ Type infobar_type,
+ TranslateErrors::Type error_type,
+ PrefService* prefs,
+ const std::string& original_language,
+ const std::string& target_language);
- virtual ~TranslateInfoBarDelegate();
-
// Returns the number of languages supported.
size_t num_languages() const { return languages_.size(); }
« no previous file with comments | « chrome/browser/three_d_api_observer.cc ('k') | chrome/browser/translate/translate_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698