OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" | 5 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 break; | 167 break; |
168 } | 168 } |
169 } | 169 } |
170 NOTREACHED(); | 170 NOTREACHED(); |
171 return string16(); | 171 return string16(); |
172 } | 172 } |
173 | 173 |
174 void ChromeJavaScriptDialogCreator::CancelPendingDialogs( | 174 void ChromeJavaScriptDialogCreator::CancelPendingDialogs( |
175 content::DialogDelegate* delegate) { | 175 content::DialogDelegate* delegate) { |
176 AppModalDialogQueue* queue = AppModalDialogQueue::GetInstance(); | 176 AppModalDialogQueue* queue = AppModalDialogQueue::GetInstance(); |
| 177 AppModalDialog* active_dialog = queue->active_dialog(); |
| 178 if (active_dialog && active_dialog->delegate() == delegate) |
| 179 active_dialog->Invalidate(); |
177 for (AppModalDialogQueue::iterator i = queue->begin(); | 180 for (AppModalDialogQueue::iterator i = queue->begin(); |
178 i != queue->end(); ++i) { | 181 i != queue->end(); ++i) { |
179 if ((*i)->delegate() == delegate) | 182 if ((*i)->delegate() == delegate) |
180 (*i)->Invalidate(); | 183 (*i)->Invalidate(); |
181 } | 184 } |
182 } | 185 } |
183 | 186 |
184 //------------------------------------------------------------------------------ | 187 //------------------------------------------------------------------------------ |
185 | 188 |
186 content::JavaScriptDialogCreator* GetJavaScriptDialogCreatorInstance() { | 189 content::JavaScriptDialogCreator* GetJavaScriptDialogCreatorInstance() { |
187 return ChromeJavaScriptDialogCreator::GetInstance(); | 190 return ChromeJavaScriptDialogCreator::GetInstance(); |
188 } | 191 } |
OLD | NEW |