Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / views / extensions / device_permissions_dialog_view.h
blob8fee89d82ad5f3d0acd61ae0997e25423687ef92
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_
8 #include "extensions/browser/api/device_permissions_prompt.h"
9 #include "ui/views/window/dialog_delegate.h"
11 namespace views {
12 class TableView;
15 class DevicePermissionsTableModel;
17 // Displays a device permissions selector prompt as a modal dialog constrained
18 // to the window/tab displaying the given web contents.
19 class DevicePermissionsDialogView : public views::DialogDelegateView {
20 public:
21 DevicePermissionsDialogView(
22 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt);
23 ~DevicePermissionsDialogView() override;
25 // views::DialogDelegateView:
26 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
27 ui::ModalType GetModalType() const override;
28 base::string16 GetWindowTitle() const override;
29 void DeleteDelegate() override;
30 bool Accept() override;
31 gfx::Size GetPreferredSize() const override;
33 private:
34 scoped_refptr<extensions::DevicePermissionsPrompt::Prompt> prompt_;
36 // Displays the list of devices.
37 views::TableView* table_view_;
38 scoped_ptr<DevicePermissionsTableModel> table_model_;
41 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_DEVICE_PERMISSIONS_DIALOG_VIEW_H_