| OLD | NEW |
| 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 "chrome/browser/extensions/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 #include "chrome/browser/extensions/extension_install_ui.h" | 6 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/infobars/infobar_tab_helper.h" | 8 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
| 10 #include "chrome/browser/themes/theme_service_factory.h" | 10 #include "chrome/browser/themes/theme_service_factory.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 31 void InstallExtension(const char* filename) { | 31 void InstallExtension(const char* filename) { |
| 32 FilePath path = ui_test_utils::GetTestFilePath( | 32 FilePath path = ui_test_utils::GetTestFilePath( |
| 33 FilePath().AppendASCII("extensions"), FilePath().AppendASCII(filename)); | 33 FilePath().AppendASCII("extensions"), FilePath().AppendASCII(filename)); |
| 34 Profile* profile = browser()->profile(); | 34 Profile* profile = browser()->profile(); |
| 35 ExtensionService* service = profile->GetExtensionService(); | 35 ExtensionService* service = profile->GetExtensionService(); |
| 36 | 36 |
| 37 ui_test_utils::WindowedNotificationObserver observer( | 37 ui_test_utils::WindowedNotificationObserver observer( |
| 38 chrome::NOTIFICATION_EXTENSION_LOADED, | 38 chrome::NOTIFICATION_EXTENSION_LOADED, |
| 39 content::NotificationService::AllSources()); | 39 content::NotificationService::AllSources()); |
| 40 | 40 |
| 41 ExtensionInstallUI* client = new ExtensionInstallUI(profile); | 41 ExtensionInstallPrompt* client = new ExtensionInstallPrompt(profile); |
| 42 scoped_refptr<CrxInstaller> installer( | 42 scoped_refptr<CrxInstaller> installer( |
| 43 CrxInstaller::Create(service, client)); | 43 CrxInstaller::Create(service, client)); |
| 44 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 44 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
| 45 installer->InstallCrx(path); | 45 installer->InstallCrx(path); |
| 46 | 46 |
| 47 observer.Wait(); | 47 observer.Wait(); |
| 48 } | 48 } |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 IN_PROC_BROWSER_TEST_F(InfoBarsTest, TestInfoBarsCloseOnNewTheme) { | 51 IN_PROC_BROWSER_TEST_F(InfoBarsTest, TestInfoBarsCloseOnNewTheme) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 78 | 78 |
| 79 ui_test_utils::WindowedNotificationObserver infobar_removed_2( | 79 ui_test_utils::WindowedNotificationObserver infobar_removed_2( |
| 80 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 80 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 81 content::NotificationService::AllSources()); | 81 content::NotificationService::AllSources()); |
| 82 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 82 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
| 83 infobar_removed_2.Wait(); | 83 infobar_removed_2.Wait(); |
| 84 EXPECT_EQ(0u, | 84 EXPECT_EQ(0u, |
| 85 browser()->GetSelectedTabContentsWrapper()->infobar_tab_helper()-> | 85 browser()->GetSelectedTabContentsWrapper()->infobar_tab_helper()-> |
| 86 infobar_count()); | 86 infobar_count()); |
| 87 } | 87 } |
| OLD | NEW |