summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_modal_dialog.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 15:40:20 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 15:40:20 +0000
commit160ad3d101988b9d842fef8b18cc49c54c9a1de5 (patch)
tree567875d2f363d0b110ad25da9a9aa07cffcaa201 /chrome/browser/app_modal_dialog.cc
parent341078d4b72bd3de280b960be6cd4ac5e5ab0265 (diff)
downloadchromium_src-160ad3d101988b9d842fef8b18cc49c54c9a1de5.zip
chromium_src-160ad3d101988b9d842fef8b18cc49c54c9a1de5.tar.gz
chromium_src-160ad3d101988b9d842fef8b18cc49c54c9a1de5.tar.bz2
Refactor AppModalDialog to more clearly isolate platform specific UI pieces and eliminate the dependency on individual frontends from cross platform code.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3398015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog.cc')
-rw-r--r--chrome/browser/app_modal_dialog.cc32
1 files changed, 20 insertions, 12 deletions
diff --git a/chrome/browser/app_modal_dialog.cc b/chrome/browser/app_modal_dialog.cc
index 09d1f33..506d76f 100644
--- a/chrome/browser/app_modal_dialog.cc
+++ b/chrome/browser/app_modal_dialog.cc
@@ -5,20 +5,20 @@
#include "chrome/browser/app_modal_dialog.h"
#include "chrome/browser/app_modal_dialog_queue.h"
+#include "chrome/browser/native_app_modal_dialog.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_type.h"
AppModalDialog::AppModalDialog(TabContents* tab_contents,
const std::wstring& title)
-#if defined(OS_WIN) || defined(OS_LINUX)
- : dialog_(NULL),
-#elif defined(OS_MACOSX)
- :
-#endif
+ : skip_this_dialog_(false),
tab_contents_(tab_contents),
- title_(title),
- skip_this_dialog_(false) {
+ native_dialog_(NULL),
+ title_(title) {
+}
+
+AppModalDialog::~AppModalDialog() {
}
void AppModalDialog::ShowModalDialog() {
@@ -33,11 +33,19 @@ void AppModalDialog::ShowModalDialog() {
NotificationService::NoDetails());
}
-void AppModalDialog::Cleanup() {
- NotificationService::current()->Notify(
- NotificationType::APP_MODAL_DIALOG_CLOSED,
- Source<AppModalDialog>(this),
- NotificationService::NoDetails());
+void AppModalDialog::CreateAndShowDialog() {
+ native_dialog_ = CreateNativeDialog();
+ native_dialog_->ShowAppModalDialog();
+}
+
+void AppModalDialog::ActivateModalDialog() {
+ DCHECK(native_dialog_);
+ native_dialog_->ActivateAppModalDialog();
+}
+
+void AppModalDialog::CloseModalDialog() {
+ DCHECK(native_dialog_);
+ native_dialog_->CloseAppModalDialog();
}
void AppModalDialog::CompleteDialog() {