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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 base::FilePath(kTestExtensionsDir), base::FilePath(name))); | 715 base::FilePath(kTestExtensionsDir), base::FilePath(name))); |
716 scoped_refptr<extensions::UnpackedInstaller> installer = | 716 scoped_refptr<extensions::UnpackedInstaller> installer = |
717 extensions::UnpackedInstaller::Create(extension_service()); | 717 extensions::UnpackedInstaller::Create(extension_service()); |
718 content::WindowedNotificationObserver observer( | 718 content::WindowedNotificationObserver observer( |
719 expect_success ? extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED | 719 expect_success ? extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED |
720 : extensions::NOTIFICATION_EXTENSION_LOAD_ERROR, | 720 : extensions::NOTIFICATION_EXTENSION_LOAD_ERROR, |
721 content::NotificationService::AllSources()); | 721 content::NotificationService::AllSources()); |
722 installer->Load(extension_path); | 722 installer->Load(extension_path); |
723 observer.Wait(); | 723 observer.Wait(); |
724 | 724 |
725 const extensions::ExtensionSet* extensions = | 725 extensions::ExtensionRegistry* registry = |
726 extension_service()->extensions(); | 726 extensions::ExtensionRegistry::Get(browser()->profile()); |
727 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); | 727 for (const scoped_refptr<const extensions::Extension>& extension : |
728 it != extensions->end(); ++it) { | 728 registry->enabled_extensions()) { |
729 if ((*it)->path() == extension_path) | 729 if (extension->path() == extension_path) |
730 return it->get(); | 730 return extension.get(); |
731 } | 731 } |
732 return NULL; | 732 return NULL; |
733 } | 733 } |
734 | 734 |
735 void UninstallExtension(const std::string& id, bool expect_success) { | 735 void UninstallExtension(const std::string& id, bool expect_success) { |
736 content::WindowedNotificationObserver observer( | 736 content::WindowedNotificationObserver observer( |
737 expect_success | 737 expect_success |
738 ? extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED | 738 ? extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED |
739 : extensions::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, | 739 : extensions::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, |
740 content::NotificationService::AllSources()); | 740 content::NotificationService::AllSources()); |
(...skipping 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3427 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3427 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3428 browser2->tab_strip_model()->GetActiveWebContents(), | 3428 browser2->tab_strip_model()->GetActiveWebContents(), |
3429 "domAutomationController.send(window.showModalDialog !== undefined);", | 3429 "domAutomationController.send(window.showModalDialog !== undefined);", |
3430 &result)); | 3430 &result)); |
3431 EXPECT_TRUE(result); | 3431 EXPECT_TRUE(result); |
3432 } | 3432 } |
3433 | 3433 |
3434 #endif // !defined(CHROME_OS) | 3434 #endif // !defined(CHROME_OS) |
3435 | 3435 |
3436 } // namespace policy | 3436 } // namespace policy |
OLD | NEW |