| Index: chrome/browser/ui/webui/managed_user_passphrase_dialog.h
|
| diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h b/chrome/browser/ui/webui/managed_user_passphrase_dialog.h
|
| similarity index 54%
|
| copy from chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
|
| copy to chrome/browser/ui/webui/managed_user_passphrase_dialog.h
|
| index 06266403d4e691b967c43a3b5955b495e868e8e8..25db3324b811651f0bc7ab2bed8380ed21541e5b 100644
|
| --- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
|
| +++ b/chrome/browser/ui/webui/managed_user_passphrase_dialog.h
|
| @@ -2,36 +2,36 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_
|
| -#define CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_
|
| -
|
| -#if !(defined(USE_AURA) || defined(OS_CHROMEOS))
|
| -#error Tab-modal confirm dialog should be shown with native UI.
|
| -#endif
|
| +#ifndef CHROME_BROWSER_UI_WEBUI_MANAGED_USER_PASSPHRASE_DIALOG_H_
|
| +#define CHROME_BROWSER_UI_WEBUI_MANAGED_USER_PASSPHRASE_DIALOG_H_
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/callback.h"
|
| #include "base/compiler_specific.h"
|
| -#include "base/memory/scoped_ptr.h"
|
| -#include "chrome/browser/ui/tab_modal_confirm_dialog.h"
|
| #include "ui/web_dialogs/web_dialog_delegate.h"
|
|
|
| class ConstrainedWebDialogDelegate;
|
| +class Profile;
|
|
|
| namespace content {
|
| class WebContents;
|
| }
|
|
|
| +namespace base {
|
| +class Value;
|
| +}
|
| +
|
| // Displays a tab-modal dialog, i.e. a dialog that will block the current page
|
| // but still allow the user to switch to a different page.
|
| // To display the dialog, allocate this object on the heap. It will open the
|
| // dialog from its constructor and then delete itself when the user dismisses
|
| // the dialog.
|
| -class TabModalConfirmDialogWebUI : public TabModalConfirmDialog,
|
| - public ui::WebDialogDelegate {
|
| +class ManagedUserPassphraseDialog : public ui::WebDialogDelegate {
|
| public:
|
| - TabModalConfirmDialogWebUI(
|
| - TabModalConfirmDialogDelegate* dialog_delegate,
|
| - content::WebContents* web_contents);
|
| + // Creates a passphrase dialog which will be deleted automatically when the
|
| + // user closes the dialog.
|
| + ManagedUserPassphraseDialog(content::WebContents* web_contents,
|
| + const base::Callback<void(bool)>& callback);
|
|
|
| // ui::WebDialogDelegate implementation.
|
| virtual ui::ModalType GetDialogModalType() const OVERRIDE;
|
| @@ -46,23 +46,15 @@ class TabModalConfirmDialogWebUI : public TabModalConfirmDialog,
|
| bool* out_close_dialog) OVERRIDE;
|
| virtual bool ShouldShowDialogTitle() const OVERRIDE;
|
|
|
| - ConstrainedWebDialogDelegate* constrained_web_dialog_delegate() {
|
| - return constrained_web_dialog_delegate_;
|
| - }
|
| -
|
| private:
|
| - virtual ~TabModalConfirmDialogWebUI();
|
| -
|
| - // TabModalConfirmDialog:
|
| - virtual void AcceptTabModalDialog() OVERRIDE;
|
| - virtual void CancelTabModalDialog() OVERRIDE;
|
| + virtual ~ManagedUserPassphraseDialog();
|
|
|
| - scoped_ptr<TabModalConfirmDialogDelegate> delegate_;
|
| + void CreateDataSource(Profile* profile) const;
|
|
|
| - // Deletes itself.
|
| - ConstrainedWebDialogDelegate* constrained_web_dialog_delegate_;
|
| + base::Callback<void(bool)> callback_;
|
| + bool closing_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogWebUI);
|
| + DISALLOW_COPY_AND_ASSIGN(ManagedUserPassphraseDialog);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_
|
| +#endif // CHROME_BROWSER_UI_WEBUI_MANAGED_USER_PASSPHRASE_DIALOG_H_
|
|
|