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

Unified Diff: chrome/browser/ui/views/extensions/device_permissions_dialog_view.h

Issue 633793002: Prompt for granting permission to access USB devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename UsbDevicesChosen -> OnUsbDevicesChosen. Created 6 years, 2 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/ui/views/extensions/device_permissions_dialog_view.h
diff --git a/chrome/browser/ui/views/extensions/device_permissions_dialog_view.h b/chrome/browser/ui/views/extensions/device_permissions_dialog_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..024f8c2b8c3da100458289ddec72a30cd524fac4
--- /dev/null
+++ b/chrome/browser/ui/views/extensions/device_permissions_dialog_view.h
@@ -0,0 +1,50 @@
+// Copyright 2014 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_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_
+
+#include "extensions/browser/api/device_permissions_prompt.h"
+#include "ui/views/window/dialog_delegate.h"
+
+namespace views {
+class TableView;
+}
+
+class DevicePermissionsTableModel;
+
+// Displays a device permissions selector prompt as a modal dialog constrained
+// to the window/tab displaying the given web contents.
+class DevicePermissionsDialogView : public views::DialogDelegateView {
+ public:
+ DevicePermissionsDialogView(
+ extensions::DevicePermissionsPrompt::Delegate* delegate,
+ scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt);
+ virtual ~DevicePermissionsDialogView();
+
+ // Overriding views::DialogDelegate.
+ virtual bool Cancel() override;
+ virtual bool Accept() override;
+
+ // Overriding views::DialogModel.
+ virtual base::string16 GetDialogButtonLabel(
+ ui::DialogButton button) const override;
+
+ // Overriding views::WidgetDelegate.
+ virtual ui::ModalType GetModalType() const override;
+ virtual base::string16 GetWindowTitle() const override;
+
+ // Overriding views::View
+ virtual gfx::Size GetPreferredSize() const override;
+
+ private:
+ extensions::DevicePermissionsPrompt::Delegate* delegate_;
+ scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt_;
+
+ // Displays the list of devices.
+ views::TableView* table_view_;
+ scoped_ptr<DevicePermissionsTableModel> table_model_;
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698