OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_DRIVER_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_DRIVER_H_ |
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_DRIVER_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_DRIVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 class GURL; | 10 class GURL; |
11 | 11 |
| 12 namespace translate { |
| 13 |
12 // Interface that allows Translate core code to interact with its driver (i.e., | 14 // Interface that allows Translate core code to interact with its driver (i.e., |
13 // obtain information from it and give information to it). A concrete | 15 // obtain information from it and give information to it). A concrete |
14 // implementation must be provided by the driver. | 16 // implementation must be provided by the driver. |
15 class TranslateDriver { | 17 class TranslateDriver { |
16 public: | 18 public: |
17 // Returns true if the current page was navigated through a link. | 19 // Returns true if the current page was navigated through a link. |
18 virtual bool IsLinkNavigation() = 0; | 20 virtual bool IsLinkNavigation() = 0; |
19 | 21 |
20 // Called when Translate is enabled or disabled. | 22 // Called when Translate is enabled or disabled. |
21 virtual void OnTranslateEnabledChanged() = 0; | 23 virtual void OnTranslateEnabledChanged() = 0; |
(...skipping 26 matching lines...) Expand all Loading... |
48 // Returns the visible URL, or an empty GURL if there is no visible URL. | 50 // Returns the visible URL, or an empty GURL if there is no visible URL. |
49 virtual const GURL& GetVisibleURL() = 0; | 51 virtual const GURL& GetVisibleURL() = 0; |
50 | 52 |
51 // Returns whether the driver has access to the current page. | 53 // Returns whether the driver has access to the current page. |
52 virtual bool HasCurrentPage() = 0; | 54 virtual bool HasCurrentPage() = 0; |
53 | 55 |
54 // Opens |url| in a new tab. | 56 // Opens |url| in a new tab. |
55 virtual void OpenUrlInNewTab(const GURL& url) = 0; | 57 virtual void OpenUrlInNewTab(const GURL& url) = 0; |
56 }; | 58 }; |
57 | 59 |
| 60 } // namespace translate |
| 61 |
58 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_DRIVER_H_ | 62 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_DRIVER_H_ |
OLD | NEW |