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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 709813004: Remove the deprecated function ExtensionService::extensions(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed thestig@'s comments. Created 6 years, 1 month 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
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 <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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/profile_resetter/profile_resetter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698