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

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

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sky's review (2) Created 7 years, 2 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 8d3a1abdc6526e4441eb20785a4c1b122be04c4c..ddbb72d47d237cdaa24f1239b41594ab47ff5a48 100644
--- a/chrome/browser/translate/translate_manager.h
+++ b/chrome/browser/translate/translate_manager.h
@@ -14,6 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/time/time.h"
+#include "chrome/browser/ui/translate/translate_bubble_model.h"
#include "chrome/common/translate/translate_errors.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -26,6 +27,7 @@ class PrefService;
class Profile;
struct ShortcutConfiguration;
class TranslateAcceptLanguages;
+class TranslateBubbleShowable;
struct TranslateErrorDetails;
struct TranslateEventDetails;
class TranslateInfoBarDelegate;
@@ -128,6 +130,11 @@ class TranslateManager : public content::NotificationObserver {
max_reload_check_attempts_ = attempts;
}
+ // Sets the object which controls how to show the bubble. This is intended to
+ // be used at tests.
+ void SetTranslateBubbleShowable(
+ scoped_ptr<TranslateBubbleShowable> translate_bubble_showable);
+
// The observer class for TranslateManager.
class Observer {
public:
@@ -191,6 +198,10 @@ class TranslateManager : public content::NotificationObserver {
// Notifies to the observers when translate failed.
void NotifyTranslateError(const TranslateErrorDetails& details);
+ // Shows the translate bubble.
+ void ShowBubble(content::WebContents* web_contents,
+ TranslateBubbleModel::ViewState view_state);
+
// Returns the different parameters used to decide whether extra shortcuts
// are needed.
static ShortcutConfiguration ShortcutConfig();
@@ -219,6 +230,9 @@ class TranslateManager : public content::NotificationObserver {
// each profiles.
scoped_ptr<TranslateAcceptLanguages> accept_languages_;
+ // An instance of TranslateBubbleShowable which show the Translate bubble.
+ scoped_ptr<TranslateBubbleShowable> bubble_showable_;
+
base::WeakPtrFactory<TranslateManager> weak_method_factory_;
DISALLOW_COPY_AND_ASSIGN(TranslateManager);

Powered by Google App Engine
This is Rietveld 408576698