Chromium Code Reviews| 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 52% |
| 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..1bdf7492fbee3373000e4947854bd1a2278b7b53 100644 |
| --- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h |
| +++ b/chrome/browser/ui/webui/managed_user_passphrase_dialog.h |
| @@ -1,37 +1,37 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2013 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. |
| -#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; |
|
James Hawkins
2013/02/12 18:57:16
nit: Document method.
Adrian Kuegel
2013/02/13 10:53:36
Done.
|
| - // Deletes itself. |
| - ConstrainedWebDialogDelegate* constrained_web_dialog_delegate_; |
| + base::Callback<void(bool)> callback_; |
|
James Hawkins
2013/02/12 18:57:16
Create a documented, well-named typedef for the ca
Adrian Kuegel
2013/02/13 10:53:36
Done.
|
| + bool closing_; |
|
James Hawkins
2013/02/12 18:57:16
nit: Document member variables.
Adrian Kuegel
2013/02/13 10:53:36
This variable is now removed.
|
| - 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_ |