OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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_LOGIN_LOGIN_HTML_DIALOG_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_HTML_DIALOG_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
| 11 #include "gfx/native_widget_types.h" |
| 12 #include "gfx/size.h" |
| 13 |
| 14 namespace chromeos { |
| 15 |
| 16 // Launches html dialog during OOBE/Login with specified URL and title. |
| 17 class LoginHtmlDialog : public HtmlDialogUIDelegate { |
| 18 public: |
| 19 // Delegate class to get notifications from the dialog. |
| 20 class Delegate { |
| 21 public: |
| 22 virtual ~Delegate() {} |
| 23 |
| 24 // Called when dialog has been closed. |
| 25 virtual void OnDialogClosed() = 0; |
| 26 }; |
| 27 |
| 28 LoginHtmlDialog(Delegate* delegate, |
| 29 gfx::NativeWindow parent_window, |
| 30 const std::wstring& title, |
| 31 const GURL& url); |
| 32 ~LoginHtmlDialog(); |
| 33 |
| 34 // Shows created dialog. |
| 35 void Show(); |
| 36 |
| 37 protected: |
| 38 // HtmlDialogUIDelegate implementation. |
| 39 virtual bool IsDialogModal() const { return true; } |
| 40 virtual std::wstring GetDialogTitle() const { return title_; } |
| 41 virtual GURL GetDialogContentURL() const { return url_; } |
| 42 virtual void GetDOMMessageHandlers( |
| 43 std::vector<DOMMessageHandler*>* handlers) const {} |
| 44 virtual void GetDialogSize(gfx::Size* size) const; |
| 45 virtual std::string GetDialogArgs() const { return std::string(); } |
| 46 virtual void OnDialogClosed(const std::string& json_retval); |
| 47 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog); |
| 48 |
| 49 private: |
| 50 // Notifications receiver. |
| 51 Delegate* delegate_; |
| 52 |
| 53 gfx::NativeWindow parent_window_; |
| 54 std::wstring title_; |
| 55 GURL url_; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(LoginHtmlDialog); |
| 58 }; |
| 59 |
| 60 } // namespace chromeos |
| 61 |
| 62 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_HTML_DIALOG_H_ |
OLD | NEW |