OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/app_modal_dialogs/app_modal_dialog_queue.h" | 5 #include "components/app_modal/app_modal_dialog_queue.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "components/app_modal_dialogs/app_modal_dialog.h" | 8 #include "components/app_modal/app_modal_dialog.h" |
9 | 9 |
10 // static | 10 // static |
11 AppModalDialogQueue* AppModalDialogQueue::GetInstance() { | 11 AppModalDialogQueue* AppModalDialogQueue::GetInstance() { |
12 return Singleton<AppModalDialogQueue>::get(); | 12 return Singleton<AppModalDialogQueue>::get(); |
13 } | 13 } |
14 | 14 |
15 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) { | 15 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) { |
16 if (!active_dialog_) { | 16 if (!active_dialog_) { |
17 ShowModalDialog(dialog); | 17 ShowModalDialog(dialog); |
18 return; | 18 return; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 AppModalDialog* AppModalDialogQueue::GetNextDialog() { | 67 AppModalDialog* AppModalDialogQueue::GetNextDialog() { |
68 while (!app_modal_dialog_queue_.empty()) { | 68 while (!app_modal_dialog_queue_.empty()) { |
69 AppModalDialog* dialog = app_modal_dialog_queue_.front(); | 69 AppModalDialog* dialog = app_modal_dialog_queue_.front(); |
70 app_modal_dialog_queue_.pop_front(); | 70 app_modal_dialog_queue_.pop_front(); |
71 if (dialog->IsValid()) | 71 if (dialog->IsValid()) |
72 return dialog; | 72 return dialog; |
73 delete dialog; | 73 delete dialog; |
74 } | 74 } |
75 return NULL; | 75 return NULL; |
76 } | 76 } |
OLD | NEW |