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

Unified Diff: chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h

Issue 1008973002: [Extensions UI] Update extensions page to use api methods for permissions prompt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h
diff --git a/chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h b/chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..59c1a21c69e152a130409e31f9f5ec109c5a91b2
--- /dev/null
+++ b/chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h
@@ -0,0 +1,59 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_SHOW_PERMISSIONS_DIALOG_HELPER_H_
+#define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_SHOW_PERMISSIONS_DIALOG_HELPER_H_
+
+#include "base/bind.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/extensions/extension_install_prompt.h"
+
+class Profile;
+
+namespace content {
+class BrowserContext;
+class WebContents;
+}
+
+namespace extensions {
+class Extension;
+
+// Helper class to handle showing a permissions dialog for an extension. Will
+// show either the newer AppInfo-style permissions dialog, or the traditional,
+// install-prompt style dialog.
+class ShowPermissionsDialogHelper : public ExtensionInstallPrompt::Delegate {
+ public:
+ static void Show(content::WebContents* web_contents,
+ content::BrowserContext* browser_context,
not at google - send to devlin 2015/03/16 17:39:55 I don't think it's necessarily worth taking action
Devlin 2015/03/16 21:10:55 I figured best to avoid the GetBrowserContext() on
+ const Extension* extension,
+ bool from_extensions_page,
not at google - send to devlin 2015/03/16 17:39:55 This flag is actually a bit confusing. I don't kno
Devlin 2015/03/16 21:10:55 The reason I said from_extensions_page was to matc
+ const base::Closure& on_complete);
+
+ private:
+ ShowPermissionsDialogHelper(Profile* profile,
+ const base::Closure& on_complete);
+ ~ShowPermissionsDialogHelper() override; // Manages its own lifetime.
+
+ // Shows the old-style (not AppInfo) permissions dialog.
+ void ShowPermissionsDialog(content::WebContents* web_contents,
+ const Extension* extension);
+
+ // ExtensionInstallPrompt::Delegate:
+ void InstallUIProceed() override;
+ void InstallUIAbort(bool user_initiated) override;
+
+ scoped_ptr<ExtensionInstallPrompt> prompt_;
+
+ Profile* profile_;
+
+ base::Closure on_complete_;
+
+ std::string extension_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShowPermissionsDialogHelper);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_SHOW_PERMISSIONS_DIALOG_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698