Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 133273029: Move LanguageState to the translate component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment + rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 content::WindowedNotificationObserver language_observer1( 1894 content::WindowedNotificationObserver language_observer1(
1895 chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, 1895 chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED,
1896 content::NotificationService::AllSources()); 1896 content::NotificationService::AllSources());
1897 ui_test_utils::NavigateToURL(browser(), url); 1897 ui_test_utils::NavigateToURL(browser(), url);
1898 language_observer1.Wait(); 1898 language_observer1.Wait();
1899 1899
1900 // Verify the translation detected for this tab. 1900 // Verify the translation detected for this tab.
1901 TranslateTabHelper* translate_tab_helper = 1901 TranslateTabHelper* translate_tab_helper =
1902 TranslateTabHelper::FromWebContents(contents); 1902 TranslateTabHelper::FromWebContents(contents);
1903 ASSERT_TRUE(translate_tab_helper); 1903 ASSERT_TRUE(translate_tab_helper);
1904 LanguageState& language_state = translate_tab_helper->language_state(); 1904 LanguageState& language_state = translate_tab_helper->GetLanguageState();
1905 EXPECT_EQ("fr", language_state.original_language()); 1905 EXPECT_EQ("fr", language_state.original_language());
1906 EXPECT_TRUE(language_state.page_needs_translation()); 1906 EXPECT_TRUE(language_state.page_needs_translation());
1907 EXPECT_FALSE(language_state.translation_pending()); 1907 EXPECT_FALSE(language_state.translation_pending());
1908 EXPECT_FALSE(language_state.translation_declined()); 1908 EXPECT_FALSE(language_state.translation_declined());
1909 EXPECT_FALSE(language_state.IsPageTranslated()); 1909 EXPECT_FALSE(language_state.IsPageTranslated());
1910 1910
1911 // Verify that the translate infobar showed up. 1911 // Verify that the translate infobar showed up.
1912 ASSERT_EQ(1u, infobar_service->infobar_count()); 1912 ASSERT_EQ(1u, infobar_service->infobar_count());
1913 InfoBar* infobar = infobar_service->infobar_at(0); 1913 InfoBar* infobar = infobar_service->infobar_at(0);
1914 TranslateInfoBarDelegate* translate_infobar_delegate = 1914 TranslateInfoBarDelegate* translate_infobar_delegate =
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2947 PrefService* prefs = browser()->profile()->GetPrefs(); 2947 PrefService* prefs = browser()->profile()->GetPrefs();
2948 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2948 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2949 prefs, "host.name")); 2949 prefs, "host.name"));
2950 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2950 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2951 prefs, "other.host.name")); 2951 prefs, "other.host.name"));
2952 } 2952 }
2953 2953
2954 #endif // !defined(CHROME_OS) 2954 #endif // !defined(CHROME_OS)
2955 2955
2956 } // namespace policy 2956 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/browser/tab_contents/language_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698