blob: 120d28e7b977b57450be124780e1efa617a462f5 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/web_dialogs/web_dialog_delegate.h"
namespace chromeos {
// SIM unlock dialog displayed in cases when SIM card has to be unlocked.
class SimDialogDelegate : public ui::WebDialogDelegate {
// Type of the SIM dialog that is launched.
typedef enum SimDialogMode {
SIM_DIALOG_UNLOCK = 0, // General unlock flow dialog (PIN/PUK).
SIM_DIALOG_CHANGE_PIN = 1, // Change PIN dialog.
SIM_DIALOG_SET_LOCK_ON = 2, // Enable RequirePin restriction.
SIM_DIALOG_SET_LOCK_OFF = 3, // Disable RequirePin restriction.
} SimDialogMode;
explicit SimDialogDelegate(SimDialogMode dialog_mode);
// Shows the SIM unlock dialog box with one of the specified modes.
static void ShowDialog(gfx::NativeWindow owning_window, SimDialogMode mode);
~SimDialogDelegate() override;
// Overridden from ui::WebDialogDelegate:
ui::ModalType GetDialogModalType() const override;
base::string16 GetDialogTitle() const override;
GURL GetDialogContentURL() const override;
void GetWebUIMessageHandlers(
std::vector<content::WebUIMessageHandler*>* handlers) const override;
void GetDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
void OnDialogClosed(const std::string& json_retval) override;
void OnCloseContents(content::WebContents* source,
bool* out_close_dialog) override;
bool ShouldShowDialogTitle() const override;
bool HandleContextMenu(const content::ContextMenuParams& params) override;
SimDialogMode dialog_mode_;
} // namespace chromeos