diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 01:16:23 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 01:16:23 +0000 |
commit | 591a59fe61d07d04b99d333628e23c73f528fa6e (patch) | |
tree | 0c3208fa9cdb5286797f5a76f66ed24607502194 /chrome/browser/policy | |
parent | 0ec7e6de19679a0bb0254b71ccfc95c40ec99cf0 (diff) | |
download | chromium_src-591a59fe61d07d04b99d333628e23c73f528fa6e.zip chromium_src-591a59fe61d07d04b99d333628e23c73f528fa6e.tar.gz chromium_src-591a59fe61d07d04b99d333628e23c73f528fa6e.tar.bz2 |
Switch InfoBarTabHelper to use WebContentsUserData.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.appspot.com/11030045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy')
-rw-r--r-- | chrome/browser/policy/policy_browsertest.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index 426c42c..70b5f84 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -973,9 +973,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, AlwaysAuthorizePlugins) { content::WebContents* contents = chrome::GetActiveWebContents(browser()); ASSERT_TRUE(contents); - TabContents* tab_contents = TabContents::FromWebContents(contents); - ASSERT_TRUE(tab_contents); - InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); + InfoBarTabHelper* infobar_helper = + InfoBarTabHelper::FromWebContents(contents); ASSERT_TRUE(infobar_helper); EXPECT_EQ(0u, infobar_helper->GetInfoBarCount()); @@ -984,7 +983,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, AlwaysAuthorizePlugins) { ui_test_utils::NavigateToURL(browser(), url); // This should have triggered the dangerous plugin infobar. ASSERT_EQ(1u, infobar_helper->GetInfoBarCount()); - InfoBarDelegate* infobar_delegate = infobar_helper->GetInfoBarDelegateAt(0); + InfoBarDelegate* infobar_delegate = + infobar_helper->GetInfoBarDelegateAt(0); EXPECT_TRUE(infobar_delegate->AsConfirmInfoBarDelegate()); // And the plugin isn't running. EXPECT_EQ(0, CountPlugins()); @@ -1270,9 +1270,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, TranslateEnabled) { // Get the |infobar_helper|, and verify that there are no infobars on startup. content::WebContents* contents = chrome::GetActiveWebContents(browser()); ASSERT_TRUE(contents); - TabContents* tab_contents = TabContents::FromWebContents(contents); - ASSERT_TRUE(tab_contents); - InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); + InfoBarTabHelper* infobar_helper = + InfoBarTabHelper::FromWebContents(contents); ASSERT_TRUE(infobar_helper); EXPECT_EQ(0u, infobar_helper->GetInfoBarCount()); @@ -1295,7 +1294,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, TranslateEnabled) { language_observer1.Wait(); // Verify that the translate infobar showed up. ASSERT_EQ(1u, infobar_helper->GetInfoBarCount()); - InfoBarDelegate* infobar_delegate = infobar_helper->GetInfoBarDelegateAt(0); + InfoBarDelegate* infobar_delegate = + infobar_helper->GetInfoBarDelegateAt(0); TranslateInfoBarDelegate* delegate = infobar_delegate->AsTranslateInfoBarDelegate(); ASSERT_TRUE(delegate); @@ -1303,7 +1303,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, TranslateEnabled) { EXPECT_EQ("fr", delegate->original_language_code()); // Now force disable translate. - ui_test_utils::CloseAllInfoBars(tab_contents); + infobar_helper->RemoveInfoBar(infobar_delegate); EXPECT_EQ(0u, infobar_helper->GetInfoBarCount()); policies.Set(key::kTranslateEnabled, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, base::Value::CreateBooleanValue(false)); |