| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_SIM_DIALOG_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 8 #include "chrome/browser/ui/webui/web_dialog_ui.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 | 10 |
| 11 namespace chromeos { | 11 namespace chromeos { |
| 12 | 12 |
| 13 // SIM unlock dialog displayed in cases when SIM card has to be unlocked. | 13 // SIM unlock dialog displayed in cases when SIM card has to be unlocked. |
| 14 class SimDialogDelegate : public HtmlDialogUIDelegate { | 14 class SimDialogDelegate : public WebDialogDelegate { |
| 15 public: | 15 public: |
| 16 // Type of the SIM dialog that is launched. | 16 // Type of the SIM dialog that is launched. |
| 17 typedef enum SimDialogMode { | 17 typedef enum SimDialogMode { |
| 18 SIM_DIALOG_UNLOCK = 0, // General unlock flow dialog (PIN/PUK). | 18 SIM_DIALOG_UNLOCK = 0, // General unlock flow dialog (PIN/PUK). |
| 19 SIM_DIALOG_CHANGE_PIN = 1, // Change PIN dialog. | 19 SIM_DIALOG_CHANGE_PIN = 1, // Change PIN dialog. |
| 20 SIM_DIALOG_SET_LOCK_ON = 2, // Enable RequirePin restriction. | 20 SIM_DIALOG_SET_LOCK_ON = 2, // Enable RequirePin restriction. |
| 21 SIM_DIALOG_SET_LOCK_OFF = 3, // Disable RequirePin restriction. | 21 SIM_DIALOG_SET_LOCK_OFF = 3, // Disable RequirePin restriction. |
| 22 } SimDialogMode; | 22 } SimDialogMode; |
| 23 | 23 |
| 24 explicit SimDialogDelegate(SimDialogMode dialog_mode); | 24 explicit SimDialogDelegate(SimDialogMode dialog_mode); |
| 25 | 25 |
| 26 // Shows the SIM unlock dialog box with one of the specified modes. | 26 // Shows the SIM unlock dialog box with one of the specified modes. |
| 27 static void ShowDialog(gfx::NativeWindow owning_window, SimDialogMode mode); | 27 static void ShowDialog(gfx::NativeWindow owning_window, SimDialogMode mode); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 virtual ~SimDialogDelegate(); | 30 virtual ~SimDialogDelegate(); |
| 31 | 31 |
| 32 // Overridden from HtmlDialogUI::Delegate: | 32 // Overridden from WebDialogDelegate: |
| 33 virtual ui::ModalType GetDialogModalType() const OVERRIDE; | 33 virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
| 34 virtual string16 GetDialogTitle() const OVERRIDE; | 34 virtual string16 GetDialogTitle() const OVERRIDE; |
| 35 virtual GURL GetDialogContentURL() const OVERRIDE; | 35 virtual GURL GetDialogContentURL() const OVERRIDE; |
| 36 virtual void GetWebUIMessageHandlers( | 36 virtual void GetWebUIMessageHandlers( |
| 37 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | 37 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
| 38 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 38 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
| 39 virtual std::string GetDialogArgs() const OVERRIDE; | 39 virtual std::string GetDialogArgs() const OVERRIDE; |
| 40 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 40 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
| 41 virtual void OnCloseContents( | 41 virtual void OnCloseContents( |
| 42 content::WebContents* source, bool* out_close_dialog) OVERRIDE; | 42 content::WebContents* source, bool* out_close_dialog) OVERRIDE; |
| 43 virtual bool ShouldShowDialogTitle() const OVERRIDE; | 43 virtual bool ShouldShowDialogTitle() const OVERRIDE; |
| 44 virtual bool HandleContextMenu( | 44 virtual bool HandleContextMenu( |
| 45 const content::ContextMenuParams& params) OVERRIDE; | 45 const content::ContextMenuParams& params) OVERRIDE; |
| 46 | 46 |
| 47 SimDialogMode dialog_mode_; | 47 SimDialogMode dialog_mode_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(SimDialogDelegate); | 49 DISALLOW_COPY_AND_ASSIGN(SimDialogDelegate); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace chromeos | 52 } // namespace chromeos |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_ | 54 #endif // CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_ |
| OLD | NEW |