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

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

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 return it->get(); 705 return it->get();
706 } 706 }
707 return NULL; 707 return NULL;
708 } 708 }
709 709
710 void UninstallExtension(const std::string& id, bool expect_success) { 710 void UninstallExtension(const std::string& id, bool expect_success) {
711 content::WindowedNotificationObserver observer( 711 content::WindowedNotificationObserver observer(
712 expect_success ? chrome::NOTIFICATION_EXTENSION_UNINSTALLED 712 expect_success ? chrome::NOTIFICATION_EXTENSION_UNINSTALLED
713 : chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, 713 : chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
714 content::NotificationService::AllSources()); 714 content::NotificationService::AllSources());
715 extension_service()->UninstallExtension(id, false, NULL); 715 extension_service()->UninstallExtension(
716 id, ExtensionService::kUninstallReasonDefault, NULL);
716 observer.Wait(); 717 observer.Wait();
717 } 718 }
718 719
719 void UpdateProviderPolicy(const PolicyMap& policy) { 720 void UpdateProviderPolicy(const PolicyMap& policy) {
720 provider_.UpdateChromePolicy(policy); 721 provider_.UpdateChromePolicy(policy);
721 DCHECK(base::MessageLoop::current()); 722 DCHECK(base::MessageLoop::current());
722 base::RunLoop loop; 723 base::RunLoop loop;
723 loop.RunUntilIdle(); 724 loop.RunUntilIdle();
724 } 725 }
725 726
(...skipping 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698