| 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_LANGUAGE_STATE_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_LANGUAGE_STATE_H_ |
| 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_LANGUAGE_STATE_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_LANGUAGE_STATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 | 11 |
| 12 namespace translate { |
| 12 class TranslateDriver; | 13 class TranslateDriver; |
| 14 } |
| 15 |
| 16 namespace translate { |
| 13 | 17 |
| 14 // This class holds the language state of the current page. | 18 // This class holds the language state of the current page. |
| 15 // There is one LanguageState instance per tab. | 19 // There is one LanguageState instance per tab. |
| 16 // It is used to determine when navigating to a new page whether it should | 20 // It is used to determine when navigating to a new page whether it should |
| 17 // automatically be translated. | 21 // automatically be translated. |
| 18 // This auto-translate behavior is the expected behavior when: | 22 // This auto-translate behavior is the expected behavior when: |
| 19 // - user is on page in language A that they had translated to language B. | 23 // - user is on page in language A that they had translated to language B. |
| 20 // - user clicks a link in that page that takes them to a page also in language | 24 // - user clicks a link in that page that takes them to a page also in language |
| 21 // A. | 25 // A. |
| 22 class LanguageState { | 26 class LanguageState { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 118 |
| 115 // Whether the current navigation is a fragment navigation (in page). | 119 // Whether the current navigation is a fragment navigation (in page). |
| 116 bool in_page_navigation_; | 120 bool in_page_navigation_; |
| 117 | 121 |
| 118 // Whether the Translate is enabled. | 122 // Whether the Translate is enabled. |
| 119 bool translate_enabled_; | 123 bool translate_enabled_; |
| 120 | 124 |
| 121 DISALLOW_COPY_AND_ASSIGN(LanguageState); | 125 DISALLOW_COPY_AND_ASSIGN(LanguageState); |
| 122 }; | 126 }; |
| 123 | 127 |
| 128 } // namespace translate |
| 129 |
| 124 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_LANGUAGE_STATE_H_ | 130 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_LANGUAGE_STATE_H_ |
| OLD | NEW |