| 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 { | 10 namespace app_modal { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 AppModalDialogQueue* AppModalDialogQueue::GetInstance() { | 13 AppModalDialogQueue* AppModalDialogQueue::GetInstance() { |
| 14 return Singleton<AppModalDialogQueue>::get(); | 14 return base::Singleton<AppModalDialogQueue>::get(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) { | 17 void AppModalDialogQueue::AddDialog(AppModalDialog* dialog) { |
| 18 if (!active_dialog_) { | 18 if (!active_dialog_) { |
| 19 ShowModalDialog(dialog); | 19 ShowModalDialog(dialog); |
| 20 return; | 20 return; |
| 21 } | 21 } |
| 22 app_modal_dialog_queue_.push_back(dialog); | 22 app_modal_dialog_queue_.push_back(dialog); |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 AppModalDialog* dialog = app_modal_dialog_queue_.front(); | 71 AppModalDialog* dialog = app_modal_dialog_queue_.front(); |
| 72 app_modal_dialog_queue_.pop_front(); | 72 app_modal_dialog_queue_.pop_front(); |
| 73 if (dialog->IsValid()) | 73 if (dialog->IsValid()) |
| 74 return dialog; | 74 return dialog; |
| 75 delete dialog; | 75 delete dialog; |
| 76 } | 76 } |
| 77 return NULL; | 77 return NULL; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace app_modal | 80 } // namespace app_modal |
| OLD | NEW |