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

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

Issue 10105030: TabContents -> WebContentsImpl, part 21. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/app_modal_dialog_queue.h" 5 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 8
9 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) { 9 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) {
10 if (!active_dialog_) { 10 if (!active_dialog_) {
11 ShowModalDialog(dialog); 11 ShowModalDialog(dialog);
12 return; 12 return;
13 } 13 }
14 app_modal_dialog_queue_.push_back(dialog); 14 app_modal_dialog_queue_.push_back(dialog);
15 } 15 }
16 16
17 void AppModalDialogQueue::ShowNextDialog() { 17 void AppModalDialogQueue::ShowNextDialog() {
18 AppModalDialog* dialog = GetNextDialog(); 18 AppModalDialog* dialog = GetNextDialog();
19 if (dialog) 19 if (dialog)
20 ShowModalDialog(dialog); 20 ShowModalDialog(dialog);
21 else 21 else
22 active_dialog_ = NULL; 22 active_dialog_ = NULL;
23 } 23 }
24 24
25 void AppModalDialogQueue::ActivateModalDialog() { 25 void AppModalDialogQueue::ActivateModalDialog() {
26 if (showing_modal_dialog_) { 26 if (showing_modal_dialog_) {
27 // As part of showing a modal dialog we may end up back in this method 27 // As part of showing a modal dialog we may end up back in this method
28 // (showing a dialog activates the TabContents, which can trigger a call 28 // (showing a dialog activates the WebContents, which can trigger a call
29 // to ActivateModalDialog). We ignore such a request as after the call to 29 // to ActivateModalDialog). We ignore such a request as after the call to
30 // activate the tab contents the dialog is shown. 30 // activate the tab contents the dialog is shown.
31 return; 31 return;
32 } 32 }
33 if (active_dialog_) 33 if (active_dialog_)
34 active_dialog_->ActivateModalDialog(); 34 active_dialog_->ActivateModalDialog();
35 } 35 }
36 36
37 AppModalDialogQueue::AppModalDialogQueue() 37 AppModalDialogQueue::AppModalDialogQueue()
38 : active_dialog_(NULL), showing_modal_dialog_(false) { 38 : active_dialog_(NULL), showing_modal_dialog_(false) {
(...skipping 21 matching lines...) Expand all
60 AppModalDialog* AppModalDialogQueue::GetNextDialog() { 60 AppModalDialog* AppModalDialogQueue::GetNextDialog() {
61 while (!app_modal_dialog_queue_.empty()) { 61 while (!app_modal_dialog_queue_.empty()) {
62 AppModalDialog* dialog = app_modal_dialog_queue_.front(); 62 AppModalDialog* dialog = app_modal_dialog_queue_.front();
63 app_modal_dialog_queue_.pop_front(); 63 app_modal_dialog_queue_.pop_front();
64 if (dialog->IsValid()) 64 if (dialog->IsValid())
65 return dialog; 65 return dialog;
66 delete dialog; 66 delete dialog;
67 } 67 }
68 return NULL; 68 return NULL;
69 } 69 }
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_manager_browsertest.cc ('k') | chrome/browser/ui/auto_login_prompter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698