Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / translate / translate_bubble_factory.h
blobb1e049763bd1775bb0fce97f2cbe304b847a100b
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/ui/translate/translate_bubble_model.h"
9 #include "components/translate/core/common/translate_errors.h"
11 class BrowserWindow;
13 namespace content {
14 class WebContents;
17 // Factory to show the Translate bubble.
18 class TranslateBubbleFactory {
19 public:
20 virtual ~TranslateBubbleFactory();
22 // Shows the translate bubble. The behavior depends on the current factory's
23 // implementation.
24 static void Show(BrowserWindow* window,
25 content::WebContents* web_contents,
26 TranslateBubbleModel::ViewState view_state,
27 TranslateErrors::Type error_type);
29 // Sets the factory to change the behavior how to show the bubble.
30 // TranslateBubbleFactory doesn't take the ownership of |factory|.
31 static void SetFactory(TranslateBubbleFactory* factory);
33 protected:
34 // Shows the translate bubble.
35 virtual void ShowImplementation(
36 BrowserWindow* window,
37 content::WebContents* web_contents,
38 TranslateBubbleModel::ViewState view_state,
39 TranslateErrors::Type error_type) = 0;
41 private:
42 static TranslateBubbleFactory* current_factory_;
45 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_