| 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 <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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 extensions::ExtensionSystem::Get(browser()->profile()); | 664 extensions::ExtensionSystem::Get(browser()->profile()); |
| 665 return system->extension_service(); | 665 return system->extension_service(); |
| 666 } | 666 } |
| 667 | 667 |
| 668 const extensions::Extension* InstallExtension( | 668 const extensions::Extension* InstallExtension( |
| 669 const base::FilePath::StringType& name) { | 669 const base::FilePath::StringType& name) { |
| 670 base::FilePath extension_path(ui_test_utils::GetTestFilePath( | 670 base::FilePath extension_path(ui_test_utils::GetTestFilePath( |
| 671 base::FilePath(kTestExtensionsDir), base::FilePath(name))); | 671 base::FilePath(kTestExtensionsDir), base::FilePath(name))); |
| 672 scoped_refptr<extensions::CrxInstaller> installer = | 672 scoped_refptr<extensions::CrxInstaller> installer = |
| 673 extensions::CrxInstaller::CreateSilent(extension_service()); | 673 extensions::CrxInstaller::CreateSilent(extension_service()); |
| 674 installer->set_allow_silent_install(true); | 674 installer->set_allow_silent_install( |
| 675 extensions::CrxInstaller::GRANT_SILENTLY); |
| 675 installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); | 676 installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); |
| 676 installer->set_creation_flags(extensions::Extension::FROM_WEBSTORE); | 677 installer->set_creation_flags(extensions::Extension::FROM_WEBSTORE); |
| 677 | 678 |
| 678 content::WindowedNotificationObserver observer( | 679 content::WindowedNotificationObserver observer( |
| 679 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 680 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 680 content::NotificationService::AllSources()); | 681 content::NotificationService::AllSources()); |
| 681 installer->InstallCrx(extension_path); | 682 installer->InstallCrx(extension_path); |
| 682 observer.Wait(); | 683 observer.Wait(); |
| 683 content::Details<const extensions::Extension> details = observer.details(); | 684 content::Details<const extensions::Extension> details = observer.details(); |
| 684 return details.ptr(); | 685 return details.ptr(); |
| (...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2971 PrefService* prefs = browser()->profile()->GetPrefs(); | 2972 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 2972 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2973 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2973 prefs, "host.name")); | 2974 prefs, "host.name")); |
| 2974 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2975 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2975 prefs, "other.host.name")); | 2976 prefs, "other.host.name")); |
| 2976 } | 2977 } |
| 2977 | 2978 |
| 2978 #endif // !defined(CHROME_OS) | 2979 #endif // !defined(CHROME_OS) |
| 2979 | 2980 |
| 2980 } // namespace policy | 2981 } // namespace policy |
| OLD | NEW |