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

Side by Side Diff: chrome/browser/ui/app_modal_dialogs/message_box_handler.cc

Issue 7661029: Fix handling of tab contents disappearing out from underneath Javascript dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check delegate too Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698