Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / bluetooth / bluetooth_pairing_dialog.h
blob2ad231775a70ed4f108a2bd288129fe32448d1fd
1 // Copyright (c) 2012 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_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/values.h"
12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/web_dialogs/web_dialog_delegate.h"
15 namespace device {
16 class BluetoothDevice;
19 namespace chromeos {
21 // Bluetooth device pairing dialog shown form ash tray bubble.
22 class BluetoothPairingDialog : public ui::WebDialogDelegate {
23 public:
24 BluetoothPairingDialog(gfx::NativeWindow parent_window,
25 const device::BluetoothDevice* device);
26 ~BluetoothPairingDialog() override;
28 void Show();
30 content::WebUI* GetWebUIForTest() { return webui_; }
32 protected:
33 // ui::WebDialogDelegate implementation.
34 ui::ModalType GetDialogModalType() const override;
35 base::string16 GetDialogTitle() const override;
36 GURL GetDialogContentURL() const override;
37 void GetWebUIMessageHandlers(
38 std::vector<content::WebUIMessageHandler*>* handlers) const override;
39 void GetDialogSize(gfx::Size* size) const override;
40 std::string GetDialogArgs() const override;
41 void OnDialogShown(content::WebUI* webui,
42 content::RenderViewHost* render_view_host) override;
43 // NOTE: This function deletes this object at the end.
44 void OnDialogClosed(const std::string& json_retval) override;
45 void OnCloseContents(content::WebContents* source,
46 bool* out_close_dialog) override;
47 bool ShouldShowDialogTitle() const override;
48 bool HandleContextMenu(const content::ContextMenuParams& params) override;
50 private:
51 gfx::NativeWindow parent_window_;
52 base::DictionaryValue device_data_;
53 content::WebUI* webui_;
55 DISALLOW_COPY_AND_ASSIGN(BluetoothPairingDialog);
58 } // namespace chromeos
60 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_