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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_CHARGER_REPLACE_CHARGER_REPLACEMENT_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_CHARGER_REPLACE_CHARGER_REPLACEMENT_DIALOG_H_
8 #include "ui/gfx/native_widget_types.h"
9 #include "ui/web_dialogs/web_dialog_delegate.h"
13 class ChargerReplacementHandler
;
15 // Spring charger replacement dialog.
16 class ChargerReplacementDialog
: public ui::WebDialogDelegate
{
18 explicit ChargerReplacementDialog(gfx::NativeWindow parent_window
);
19 virtual ~ChargerReplacementDialog();
21 // True if ChargerReplacementDialog should be shown.
22 static bool ShouldShowDialog();
24 static void SetFocusOnChargerDialogIfVisible();
27 void set_can_close(bool can_close
) { can_close_
= can_close
; }
30 // ui::WebDialogDelegate implementation.
31 virtual ui::ModalType
GetDialogModalType() const OVERRIDE
;
32 virtual base::string16
GetDialogTitle() const OVERRIDE
;
33 virtual GURL
GetDialogContentURL() const OVERRIDE
;
34 virtual void GetWebUIMessageHandlers(
35 std::vector
<content::WebUIMessageHandler
*>* handlers
) const OVERRIDE
;
36 virtual void GetMinimumDialogSize(gfx::Size
* size
) const OVERRIDE
;
37 virtual void GetDialogSize(gfx::Size
* size
) const OVERRIDE
;
38 virtual std::string
GetDialogArgs() const OVERRIDE
;
39 virtual bool CanCloseDialog() const OVERRIDE
;
40 // NOTE: This function deletes this object at the end.
41 virtual void OnDialogClosed(const std::string
& json_retval
) OVERRIDE
;
42 virtual void OnCloseContents(
43 content::WebContents
* source
, bool* out_close_dialog
) OVERRIDE
;
44 virtual bool ShouldShowDialogTitle() const OVERRIDE
;
45 virtual bool HandleContextMenu(
46 const content::ContextMenuParams
& params
) OVERRIDE
;
48 static bool is_window_visible_
;
49 static gfx::NativeWindow current_window_
;
51 const gfx::NativeWindow parent_window_
;
53 ChargerReplacementHandler
* charger_replacement_handler_
;
55 DISALLOW_COPY_AND_ASSIGN(ChargerReplacementDialog
);
58 } // namespace chromeos
60 #endif // CHROME_BROWSER_CHROMEOS_CHARGER_REPLACE_CHARGER_REPLACEMENT_DIALOG_H_