Index: chrome/browser/ui/webui/managed_user_passphrase_dialog_webui.h |
diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h b/chrome/browser/ui/webui/managed_user_passphrase_dialog_webui.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_webui.h |
index 06266403d4e691b967c43a3b5955b495e868e8e8..4b653899bd4fc6861dc1c1098502ffdcbe77bab0 100644 |
--- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h |
+++ b/chrome/browser/ui/webui/managed_user_passphrase_dialog_webui.h |
@@ -2,36 +2,37 @@ |
// 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_WEBUI_H_ |
+#define CHROME_BROWSER_UI_WEBUI_MANAGED_USER_PASSPHRASE_DIALOG_WEBUI_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 ManagedUserPassphraseDialogWebUI : public ui::WebDialogDelegate { |
public: |
- TabModalConfirmDialogWebUI( |
- TabModalConfirmDialogDelegate* dialog_delegate, |
- content::WebContents* web_contents); |
+ // creates a passphrase dialog which will be deleted automatically when the |
Bernhard Bauer
2013/01/07 14:20:22
Nit: Capitalize the sentence please.
Pam (message me for reviews)
2013/01/07 14:51:49
Also please end it with a period.
|
+ // user closes the dialog |
+ static void CreateManagedUserPassphraseDialog( |
+ content::WebContents* web_contents, |
+ const base::Callback<void(void)>& callback); |
// ui::WebDialogDelegate implementation. |
virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
@@ -43,26 +44,19 @@ class TabModalConfirmDialogWebUI : public TabModalConfirmDialog, |
virtual std::string GetDialogArgs() const OVERRIDE; |
virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
virtual void OnCloseContents(content::WebContents* source, |
- bool* out_close_dialog) OVERRIDE; |
+ 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; |
- |
- scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
+ ManagedUserPassphraseDialogWebUI(content::WebContents* web_contents, |
+ const base::Callback<void(void)>& callback); |
+ virtual ~ManagedUserPassphraseDialogWebUI(); |
Bernhard Bauer
2013/01/07 14:20:22
Please add a newline.
|
+ void CreateDataSource(Profile* profile); |
- // Deletes itself. |
- ConstrainedWebDialogDelegate* constrained_web_dialog_delegate_; |
+ base::Callback<void(void)> callback_; |
Bernhard Bauer
2013/01/07 14:20:22
This is typedef'd as a base::Closure.
|
+ bool closing_; |
- DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogWebUI); |
+ DISALLOW_COPY_AND_ASSIGN(ManagedUserPassphraseDialogWebUI); |
}; |
-#endif // CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_ |
+#endif // CHROME_BROWSER_UI_WEBUI_MANAGED_USER_PASSPHRASE_DIALOG_WEBUI_H_ |