OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_ |
6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_ |
7 | 7 |
8 #include "chrome/browser/ui/translate/translate_bubble_model.h" | 8 #include "chrome/browser/ui/translate/translate_bubble_model.h" |
| 9 #include "chrome/common/translate/translate_errors.h" |
9 | 10 |
10 class BrowserWindow; | 11 class BrowserWindow; |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 class WebContents; | 14 class WebContents; |
14 } | 15 } |
15 | 16 |
16 // Factory to show the Translate bubble. | 17 // Factory to show the Translate bubble. |
17 class TranslateBubbleFactory { | 18 class TranslateBubbleFactory { |
18 public: | 19 public: |
19 virtual ~TranslateBubbleFactory(); | 20 virtual ~TranslateBubbleFactory(); |
20 | 21 |
21 // Shows the translate bubble. The behavior depends on the current factory's | 22 // Shows the translate bubble. The behavior depends on the current factory's |
22 // implementation. | 23 // implementation. |
23 static void Show(BrowserWindow* window, | 24 static void Show(BrowserWindow* window, |
24 content::WebContents* web_contents, | 25 content::WebContents* web_contents, |
25 TranslateBubbleModel::ViewState view_state); | 26 TranslateBubbleModel::ViewState view_state, |
| 27 TranslateErrors::Type error_type); |
26 | 28 |
27 // Sets the factory to change the behavior how to show the bubble. | 29 // Sets the factory to change the behavior how to show the bubble. |
28 // TranslateBubbleFactory doesn't take the ownership of |factory|. | 30 // TranslateBubbleFactory doesn't take the ownership of |factory|. |
29 static void SetFactory(TranslateBubbleFactory* factory); | 31 static void SetFactory(TranslateBubbleFactory* factory); |
30 | 32 |
31 protected: | 33 protected: |
32 // Shows the translate bubble. | 34 // Shows the translate bubble. |
33 virtual void ShowImplementation( | 35 virtual void ShowImplementation( |
34 BrowserWindow* window, | 36 BrowserWindow* window, |
35 content::WebContents* web_contents, | 37 content::WebContents* web_contents, |
36 TranslateBubbleModel::ViewState view_state) = 0; | 38 TranslateBubbleModel::ViewState view_state, |
| 39 TranslateErrors::Type error_type) = 0; |
37 | 40 |
38 private: | 41 private: |
39 static TranslateBubbleFactory* current_factory_; | 42 static TranslateBubbleFactory* current_factory_; |
40 }; | 43 }; |
41 | 44 |
42 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_ | 45 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_FACTORY_H_ |
OLD | NEW |