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

Side by Side Diff: chrome/browser/chromeos/charger_replace/charger_replacement_dialog.h

Issue 107103004: Implement the spring charger replacement UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Point iFrame to production site. Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CHARGER_REPLACE_CHARGER_REPLACEMENT_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_ 6 #define CHROME_BROWSER_CHROMEOS_CHARGER_REPLACE_CHARGER_REPLACEMENT_DIALOG_H_
7 7
8 #include <string>
9
10 #include "base/compiler_specific.h"
11 #include "base/values.h"
12 #include "ui/gfx/native_widget_types.h" 8 #include "ui/gfx/native_widget_types.h"
13 #include "ui/web_dialogs/web_dialog_delegate.h" 9 #include "ui/web_dialogs/web_dialog_delegate.h"
14 10
15 namespace device {
16 class BluetoothDevice;
17 }
18
19 namespace chromeos { 11 namespace chromeos {
20 12
21 // Bluetooth device pairing dialog shown form ash tray bubble. 13 class ChargerReplacementHandler;
22 class BluetoothPairingDialog : public ui::WebDialogDelegate { 14
15 // Spring charger replacement dialog.
16 class ChargerReplacementDialog : public ui::WebDialogDelegate {
23 public: 17 public:
24 BluetoothPairingDialog(gfx::NativeWindow parent_window, 18 explicit ChargerReplacementDialog(gfx::NativeWindow parent_window);
25 const device::BluetoothDevice* device); 19 virtual ~ChargerReplacementDialog();
26 virtual ~BluetoothPairingDialog(); 20
21 // True if ChargerReplacementDialog should be shown.
22 static bool ShouldShowDialog();
27 23
28 void Show(); 24 void Show();
25 void set_can_close(bool can_close) { can_close_ = can_close; }
29 26
30 protected: 27 private:
31 // ui::WebDialogDelegate implementation. 28 // ui::WebDialogDelegate implementation.
32 virtual ui::ModalType GetDialogModalType() const OVERRIDE; 29 virtual ui::ModalType GetDialogModalType() const OVERRIDE;
33 virtual base::string16 GetDialogTitle() const OVERRIDE; 30 virtual string16 GetDialogTitle() const OVERRIDE;
34 virtual GURL GetDialogContentURL() const OVERRIDE; 31 virtual GURL GetDialogContentURL() const OVERRIDE;
35 virtual void GetWebUIMessageHandlers( 32 virtual void GetWebUIMessageHandlers(
36 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; 33 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
34 virtual void GetMinimumDialogSize(gfx::Size* size) const OVERRIDE;
37 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; 35 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
38 virtual std::string GetDialogArgs() const OVERRIDE; 36 virtual std::string GetDialogArgs() const OVERRIDE;
37 virtual bool CanCloseDialog() const OVERRIDE;
39 // NOTE: This function deletes this object at the end. 38 // NOTE: This function deletes this object at the end.
40 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; 39 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
41 virtual void OnCloseContents( 40 virtual void OnCloseContents(
42 content::WebContents* source, bool* out_close_dialog) OVERRIDE; 41 content::WebContents* source, bool* out_close_dialog) OVERRIDE;
43 virtual bool ShouldShowDialogTitle() const OVERRIDE; 42 virtual bool ShouldShowDialogTitle() const OVERRIDE;
44 virtual bool HandleContextMenu( 43 virtual bool HandleContextMenu(
45 const content::ContextMenuParams& params) OVERRIDE; 44 const content::ContextMenuParams& params) OVERRIDE;
46 45
47 private: 46 static bool is_window_visible_;
47
48 gfx::NativeWindow parent_window_; 48 gfx::NativeWindow parent_window_;
49 DictionaryValue device_data_; 49 bool can_close_;
50 ChargerReplacementHandler* charger_replacement_handler_;
50 51
51 DISALLOW_COPY_AND_ASSIGN(BluetoothPairingDialog); 52 DISALLOW_COPY_AND_ASSIGN(ChargerReplacementDialog);
52 }; 53 };
53 54
54 } // namespace chromeos 55 } // namespace chromeos
55 56
56 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_PAIRING_DIALOG_H_ 57 #endif // CHROME_BROWSER_CHROMEOS_CHARGER_REPLACE_CHARGER_REPLACEMENT_DIALOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698