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

Side by Side Diff: chrome/browser/infobars/infobars_browsertest.cc

Issue 10388252: Refactoring ExtenionInstallUI to abstract the Browser references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced + mac fix Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698