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

Unified Diff: chrome/browser/extensions/extension_install_dialog.cc

Issue 8520035: Revert 110264 - Fix for management API related to escalated permissions disabled extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_install_dialog.cc
===================================================================
--- chrome/browser/extensions/extension_install_dialog.cc (revision 110267)
+++ chrome/browser/extensions/extension_install_dialog.cc (working copy)
@@ -4,16 +4,12 @@
#include "chrome/browser/extensions/extension_install_dialog.h"
-#include "base/bind.h"
#include "base/file_path.h"
-#include "base/message_loop.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/common/extensions/extension.h"
-namespace {
-
-// A flag used for SetExtensionInstallDialogAutoConfirmForTests
+// A flag used for SetExtensionInstallDialogForManifestAutoConfirmForTests
enum AutoConfirmForTest {
DO_NOT_SKIP = 0,
PROCEED,
@@ -21,37 +17,6 @@
};
AutoConfirmForTest auto_confirm_for_tests = DO_NOT_SKIP;
-void AutoConfirmTask(ExtensionInstallUI::Delegate* delegate, bool proceed) {
- if (proceed)
- delegate->InstallUIProceed();
- else
- delegate->InstallUIAbort(true);
-}
-
-void DoAutoConfirm(ExtensionInstallUI::Delegate* delegate) {
- bool proceed = (auto_confirm_for_tests == PROCEED);
- // We use PostTask instead of calling the delegate directly here, because in
- // the real implementations it's highly likely the message loop will be
- // pumping a few times before the user clicks accept or cancel.
- MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&AutoConfirmTask, delegate, proceed));
-}
-
-} // namespace
-
-void ShowExtensionInstallDialog(Profile* profile,
- ExtensionInstallUI::Delegate* delegate,
- const Extension* extension,
- SkBitmap* icon,
- const ExtensionInstallUI::Prompt& prompt) {
- if (auto_confirm_for_tests != DO_NOT_SKIP) {
- DoAutoConfirm(delegate);
- return;
- }
- ShowExtensionInstallDialogImpl(profile, delegate, extension, icon, prompt);
-}
-
bool ShowExtensionInstallDialogForManifest(
Profile *profile,
ExtensionInstallUI::Delegate* delegate,
@@ -94,7 +59,10 @@
// In tests, we may have setup to proceed or abort without putting up the real
// confirmation dialog.
if (auto_confirm_for_tests != DO_NOT_SKIP) {
- DoAutoConfirm(delegate);
+ if (auto_confirm_for_tests == PROCEED)
+ delegate->InstallUIProceed();
+ else
+ delegate->InstallUIAbort(true);
return true;
}
@@ -110,7 +78,7 @@
return true;
}
-void SetExtensionInstallDialogAutoConfirmForTests(
+void SetExtensionInstallDialogForManifestAutoConfirmForTests(
bool should_proceed) {
auto_confirm_for_tests = should_proceed ? PROCEED : ABORT;
}
« no previous file with comments | « chrome/browser/extensions/extension_install_dialog.h ('k') | chrome/browser/extensions/extension_management_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698