Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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_UI_WEBUI_CHROMEOS_KIOSK_MODE_LOGOUT_DIALOG_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_KIOSK_MODE_LOGOUT_DIALOG_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/string16.h" | |
| 14 #include "base/values.h" | |
| 15 #include "chrome/browser/ui/webui/html_dialog_ui.h" | |
| 16 #include "content/public/browser/web_ui_message_handler.h" | |
| 17 #include "ui/gfx/native_widget_types.h" | |
| 18 | |
| 19 | |
| 20 class KioskModeLogoutDialogHandler; | |
| 21 | |
| 22 class KioskModeLogoutDialog : private HtmlDialogUIDelegate { | |
| 23 public: | |
| 24 static void ShowKioskModeLogoutDialog(); | |
| 25 static void CloseKioskModeLogoutDialog(); | |
| 26 | |
| 27 private: | |
| 28 explicit KioskModeLogoutDialog(); | |
| 29 virtual ~KioskModeLogoutDialog(); | |
| 30 | |
| 31 void ShowDialog(); | |
| 32 void CloseDialog(); | |
| 33 | |
| 34 // HtmlDialogUIDelegate methods | |
| 35 virtual ui::ModalType GetDialogModalType() const OVERRIDE; | |
| 36 virtual string16 GetDialogTitle() const OVERRIDE; | |
| 37 virtual GURL GetDialogContentURL() const OVERRIDE; | |
| 38 virtual void GetWebUIMessageHandlers( | |
| 39 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | |
| 40 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | |
| 41 virtual std::string GetDialogArgs() const OVERRIDE; | |
| 42 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | |
| 43 virtual void OnCloseContents(content::WebContents* source, | |
| 44 bool* out_close_dialog) OVERRIDE; | |
| 45 virtual bool ShouldShowDialogTitle() const OVERRIDE; | |
| 46 | |
| 47 content::WebContents* contents_; | |
| 48 KioskModeLogoutDialogHandler* handler_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(KioskModeLogoutDialog); | |
| 51 }; | |
| 52 | |
| 53 class KioskModeLogoutDialogHandler : public content::WebUIMessageHandler { | |
|
xiyuan
2012/01/20 18:23:44
Think you can move this into cc file since it shou
rkc
2012/01/26 03:37:23
Done.
| |
| 54 public: | |
| 55 explicit KioskModeLogoutDialogHandler() {} | |
| 56 virtual void RegisterMessages() OVERRIDE; | |
| 57 void CloseDialog(); | |
| 58 | |
| 59 private: | |
| 60 void RequestRestart(const base::ListValue*); | |
| 61 | |
| 62 content::WebContents* contents_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(KioskModeLogoutDialogHandler); | |
| 65 }; | |
| 66 | |
| 67 class KioskModeLogoutDialogUI : public HtmlDialogUI { | |
| 68 public: | |
| 69 explicit KioskModeLogoutDialogUI(content::WebUI* web_ui); | |
| 70 virtual ~KioskModeLogoutDialogUI() {} | |
| 71 | |
| 72 private: | |
| 73 DISALLOW_COPY_AND_ASSIGN(KioskModeLogoutDialogUI); | |
| 74 }; | |
| 75 | |
| 76 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_KIOSK_MODE_LOGOUT_DIALOG_H_ | |
| OLD | NEW |