NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / ui / translate / translate_bubble_factory.h
blob7845a216ec69816b9ac70564982a7e6fd7785174
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_
6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_
8 #include "chrome/browser/translate/translate_tab_helper.h"
9 #include "chrome/browser/ui/translate/translate_bubble_model.h"
10 #include "components/translate/core/common/translate_errors.h"
12 class BrowserWindow;
14 namespace content {
15 class WebContents;
18 // Factory to show the Translate bubble.
19 class TranslateBubbleFactory {
20 public:
21 virtual ~TranslateBubbleFactory();
23 // Shows the translate bubble. The behavior depends on the current factory's
24 // implementation.
25 static void Show(BrowserWindow* window,
26 content::WebContents* web_contents,
27 TranslateTabHelper::TranslateStep step,
28 TranslateErrors::Type error_type);
30 // Sets the factory to change the behavior how to show the bubble.
31 // TranslateBubbleFactory doesn't take the ownership of |factory|.
32 static void SetFactory(TranslateBubbleFactory* factory);
34 protected:
35 // Shows the translate bubble.
36 virtual void ShowImplementation(BrowserWindow* window,
37 content::WebContents* web_contents,
38 TranslateTabHelper::TranslateStep step,
39 TranslateErrors::Type error_type) = 0;
41 private:
42 static TranslateBubbleFactory* current_factory_;
45 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_