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

Unified Diff: chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.mm

Issue 2390823005: Update device permissions dialog ui for Chrome apps and extensions (Closed)
Patch Set: address more comments Created 4 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/ui/cocoa/extensions/chooser_dialog_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.mm b/chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.mm
index a4b9d07171a9abd3b94c7936bc8c7bc21744d27f..21c71222acbd9776214560973b71dea92ec569c9 100644
--- a/chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.mm
@@ -9,7 +9,9 @@
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/chooser_controller/chooser_controller.h"
+#include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h"
#include "chrome/browser/extensions/chrome_extension_chooser_dialog.h"
+#include "chrome/browser/extensions/device_permissions_dialog_controller.h"
#include "chrome/browser/ui/browser_dialogs.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h"
@@ -64,3 +66,17 @@ void ChromeExtensionChooserDialog::ShowDialog(
chooser_dialog->ShowDialog();
}
}
+
+void ChromeDevicePermissionsPrompt::ShowDialog() {
+ if (chrome::ToolkitViewsWebUIDialogsEnabled())
+ return ChromeDevicePermissionsPrompt::ShowDialogViews();
+
+ std::unique_ptr<ChooserController> chooser_controller(
+ new DevicePermissionsDialogController(web_contents()->GetMainFrame(),
+ prompt()));
+
+ // These objects will delete themselves when the dialog closes.
+ ChooserDialogCocoa* chooser_dialog =
+ new ChooserDialogCocoa(web_contents(), std::move(chooser_controller));
+ chooser_dialog->ShowDialog();
+}

Powered by Google App Engine
This is Rietveld 408576698