Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Unified Diff: chrome/browser/automation/automation_provider.cc

Issue 27080: AppModalDialogQueue shouldn't depend on views. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/app_modal_dialog_queue_unittest.cc ('k') | chrome/browser/browser.vcproj » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider.cc
===================================================================
--- chrome/browser/automation/automation_provider.cc (revision 10204)
+++ chrome/browser/automation/automation_provider.cc (working copy)
@@ -8,6 +8,7 @@
#include "base/path_service.h"
#include "base/thread.h"
#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/browser/app_modal_dialog_delegate.h"
#include "chrome/browser/app_modal_dialog_queue.h"
#include "chrome/browser/automation/automation_provider_list.h"
#include "chrome/browser/automation/ui_controls.h"
@@ -33,7 +34,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/pref_service.h"
-#include "chrome/views/app_modal_dialog_delegate.h"
+#include "chrome/views/dialog_delegate.h"
#include "chrome/views/window.h"
#include "chrome/test/automation/automation_messages.h"
#include "net/base/cookie_monster.h"
@@ -1162,22 +1163,26 @@
void AutomationProvider::GetShowingAppModalDialog(bool* showing_dialog,
int* dialog_button) {
- views::AppModalDialogDelegate* dialog_delegate =
- AppModalDialogQueue::active_dialog();
- *showing_dialog = (dialog_delegate != NULL);
- if (*showing_dialog)
- *dialog_button = dialog_delegate->GetDialogButtons();
- else
- *dialog_button = views::DialogDelegate::DIALOGBUTTON_NONE;
+ *showing_dialog = AppModalDialogQueue::HasActiveDialog();
+ *dialog_button = views::DialogDelegate::DIALOGBUTTON_NONE;
+ if (!*showing_dialog)
+ return;
+
+ views::DialogDelegate* dialog_delegate =
+ AppModalDialogQueue::active_dialog()->GetTestingInterface()->
+ GetDialogDelegate();
+ *dialog_button = dialog_delegate->GetDialogButtons();
}
void AutomationProvider::ClickAppModalDialogButton(int button, bool* success) {
*success = false;
+ if (!AppModalDialogQueue::HasActiveDialog())
+ return;
- views::AppModalDialogDelegate* dialog_delegate =
- AppModalDialogQueue::active_dialog();
- if (dialog_delegate &&
- (dialog_delegate->GetDialogButtons() & button) == button) {
+ views::DialogDelegate* dialog_delegate =
+ AppModalDialogQueue::active_dialog()->GetTestingInterface()->
+ GetDialogDelegate();
+ if ((dialog_delegate->GetDialogButtons() & button) == button) {
views::DialogClientView* client_view =
dialog_delegate->window()->client_view()->AsDialogClientView();
if ((button & views::DialogDelegate::DIALOGBUTTON_OK) ==
« no previous file with comments | « chrome/browser/app_modal_dialog_queue_unittest.cc ('k') | chrome/browser/browser.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698