| 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 #include "components/translate/core/browser/language_state.h" | 5 #include "components/translate/core/browser/language_state.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "components/translate/core/browser/language_state.h" | 8 #include "components/translate/core/browser/language_state.h" |
| 9 #include "components/translate/core/browser/translate_driver.h" | 9 #include "components/translate/core/browser/translate_driver.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual void OnTranslateEnabledChanged() OVERRIDE { | 36 virtual void OnTranslateEnabledChanged() OVERRIDE { |
| 37 on_translate_enabled_changed_called_ = true; | 37 on_translate_enabled_changed_called_ = true; |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual bool IsLinkNavigation() OVERRIDE { | 40 virtual bool IsLinkNavigation() OVERRIDE { |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 virtual LanguageState& GetLanguageState() OVERRIDE { | |
| 45 return language_state_; | |
| 46 } | |
| 47 | |
| 48 virtual void TranslatePage(const std::string& translate_script, | 44 virtual void TranslatePage(const std::string& translate_script, |
| 49 const std::string& source_lang, | 45 const std::string& source_lang, |
| 50 const std::string& target_lang) OVERRIDE {} | 46 const std::string& target_lang) OVERRIDE {} |
| 51 | 47 |
| 52 virtual void RevertTranslation() OVERRIDE {} | 48 virtual void RevertTranslation() OVERRIDE {} |
| 53 | 49 |
| 54 virtual bool IsOffTheRecord() OVERRIDE { return false; } | 50 virtual bool IsOffTheRecord() OVERRIDE { return false; } |
| 55 | 51 |
| 56 virtual const std::string& GetContentsMimeType() OVERRIDE { | 52 virtual const std::string& GetContentsMimeType() OVERRIDE { |
| 57 return kHtmlMimeType; | 53 return kHtmlMimeType; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 137 |
| 142 // Translate. | 138 // Translate. |
| 143 language_state.SetCurrentLanguage("en"); | 139 language_state.SetCurrentLanguage("en"); |
| 144 EXPECT_TRUE(language_state.IsPageTranslated()); | 140 EXPECT_TRUE(language_state.IsPageTranslated()); |
| 145 EXPECT_TRUE(driver->on_is_page_translated_changed_called()); | 141 EXPECT_TRUE(driver->on_is_page_translated_changed_called()); |
| 146 | 142 |
| 147 // Translate feature must be enabled after an actual translation. | 143 // Translate feature must be enabled after an actual translation. |
| 148 EXPECT_TRUE(language_state.translate_enabled()); | 144 EXPECT_TRUE(language_state.translate_enabled()); |
| 149 EXPECT_TRUE(driver->on_translate_enabled_changed_called()); | 145 EXPECT_TRUE(driver->on_translate_enabled_changed_called()); |
| 150 } | 146 } |
| OLD | NEW |