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/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/app_modal_dialog.h" | 8 #include "components/app_modal/app_modal_dialog.h" |
9 | 9 |
| 10 namespace app_modal { |
| 11 |
10 // static | 12 // static |
11 AppModalDialogQueue* AppModalDialogQueue::GetInstance() { | 13 AppModalDialogQueue* AppModalDialogQueue::GetInstance() { |
12 return Singleton<AppModalDialogQueue>::get(); | 14 return Singleton<AppModalDialogQueue>::get(); |
13 } | 15 } |
14 | 16 |
15 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) { | 17 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) { |
16 if (!active_dialog_) { | 18 if (!active_dialog_) { |
17 ShowModalDialog(dialog); | 19 ShowModalDialog(dialog); |
18 return; | 20 return; |
19 } | 21 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 AppModalDialog* AppModalDialogQueue::GetNextDialog() { | 69 AppModalDialog* AppModalDialogQueue::GetNextDialog() { |
68 while (!app_modal_dialog_queue_.empty()) { | 70 while (!app_modal_dialog_queue_.empty()) { |
69 AppModalDialog* dialog = app_modal_dialog_queue_.front(); | 71 AppModalDialog* dialog = app_modal_dialog_queue_.front(); |
70 app_modal_dialog_queue_.pop_front(); | 72 app_modal_dialog_queue_.pop_front(); |
71 if (dialog->IsValid()) | 73 if (dialog->IsValid()) |
72 return dialog; | 74 return dialog; |
73 delete dialog; | 75 delete dialog; |
74 } | 76 } |
75 return NULL; | 77 return NULL; |
76 } | 78 } |
| 79 |
| 80 } // namespace app_modal |
OLD | NEW |