summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-21 23:49:18 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-21 23:49:18 +0000
commit478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d (patch)
treef995985b8749bd31da7cbb73ec73cfce24e97987 /chrome/browser/automation
parent69e38eca8034fe35c22744f59bee77f987ae8755 (diff)
downloadchromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.zip
chromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.tar.gz
chromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.tar.bz2
Reland r14146 which refactors DialogButton into cross platform
code. This is the same as the last change except I renamed class MessageBox to class MessageBoxFlags to avoid conflicting with the same name in windows.h. Review URL: http://codereview.chromium.org/87065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 8383feb..1a5fd90 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/message_box_flags.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/platform_util.h"
#include "chrome/common/pref_service.h"
@@ -46,7 +47,6 @@
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/views/bookmark_bar_view.h"
#include "chrome/browser/views/location_bar_view.h"
-#include "chrome/views/window/dialog_delegate.h"
#include "chrome/views/window/window.h"
#endif // defined(OS_WIN)
@@ -1297,9 +1297,6 @@ void AutomationProvider::GetBrowserWindowCount(int* window_count) {
*window_count = static_cast<int>(BrowserList::size());
}
-#if defined(OS_WIN)
-// TODO(port): Move the views::DialogDelegate::DialogButton enum out into a
-// common place then remove the OS_WIN guard.
void AutomationProvider::GetShowingAppModalDialog(bool* showing_dialog,
int* dialog_button) {
AppModalDialog* dialog_delegate = AppModalDialogQueue::active_dialog();
@@ -1307,7 +1304,7 @@ void AutomationProvider::GetShowingAppModalDialog(bool* showing_dialog,
if (*showing_dialog)
*dialog_button = dialog_delegate->GetDialogButtons();
else
- *dialog_button = views::DialogDelegate::DIALOGBUTTON_NONE;
+ *dialog_button = MessageBoxFlags::DIALOGBUTTON_NONE;
}
void AutomationProvider::ClickAppModalDialogButton(int button, bool* success) {
@@ -1316,20 +1313,19 @@ void AutomationProvider::ClickAppModalDialogButton(int button, bool* success) {
AppModalDialog* dialog_delegate = AppModalDialogQueue::active_dialog();
if (dialog_delegate &&
(dialog_delegate->GetDialogButtons() & button) == button) {
- if ((button & views::DialogDelegate::DIALOGBUTTON_OK) ==
- views::DialogDelegate::DIALOGBUTTON_OK) {
+ if ((button & MessageBoxFlags::DIALOGBUTTON_OK) ==
+ MessageBoxFlags::DIALOGBUTTON_OK) {
dialog_delegate->AcceptWindow();
*success = true;
}
- if ((button & views::DialogDelegate::DIALOGBUTTON_CANCEL) ==
- views::DialogDelegate::DIALOGBUTTON_CANCEL) {
+ if ((button & MessageBoxFlags::DIALOGBUTTON_CANCEL) ==
+ MessageBoxFlags::DIALOGBUTTON_CANCEL) {
DCHECK(!*success) << "invalid param, OK and CANCEL specified";
dialog_delegate->CancelWindow();
*success = true;
}
}
}
-#endif
void AutomationProvider::GetBrowserWindow(int index, int* handle) {
*handle = 0;