• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_
7 
8 #include <string>
9 
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"
14 
15 namespace device {
16 class BluetoothDevice;
17 }
18 
19 namespace chromeos {
20 
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   virtual ~BluetoothPairingDialog();
27 
28   void Show();
29 
30  protected:
31   // ui::WebDialogDelegate implementation.
32   virtual ui::ModalType GetDialogModalType() const OVERRIDE;
33   virtual base::string16 GetDialogTitle() const OVERRIDE;
34   virtual GURL GetDialogContentURL() const OVERRIDE;
35   virtual void GetWebUIMessageHandlers(
36       std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
37   virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
38   virtual std::string GetDialogArgs() const OVERRIDE;
39   // NOTE: This function deletes this object at the end.
40   virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
41   virtual void OnCloseContents(
42       content::WebContents* source, bool* out_close_dialog) OVERRIDE;
43   virtual bool ShouldShowDialogTitle() const OVERRIDE;
44   virtual bool HandleContextMenu(
45       const content::ContextMenuParams& params) OVERRIDE;
46 
47  private:
48   gfx::NativeWindow parent_window_;
49   base::DictionaryValue device_data_;
50 
51   DISALLOW_COPY_AND_ASSIGN(BluetoothPairingDialog);
52 };
53 
54 }  // namespace chromeos
55 
56 #endif  // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_
57