| 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 #ifndef COMPONENTS_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ | 5 #ifndef COMPONENTS_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ |
| 6 #define COMPONENTS_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ | 6 #define COMPONENTS_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 | 11 |
| 12 template <typename T> struct DefaultSingletonTraits; |
| 13 |
| 14 namespace app_modal_dialogs { |
| 15 |
| 12 class AppModalDialog; | 16 class AppModalDialog; |
| 13 | 17 |
| 14 template <typename T> struct DefaultSingletonTraits; | |
| 15 | |
| 16 // Keeps a queue of AppModalDialogs, making sure only one app modal | 18 // Keeps a queue of AppModalDialogs, making sure only one app modal |
| 17 // dialog is shown at a time. | 19 // dialog is shown at a time. |
| 18 // This class is a singleton. | 20 // This class is a singleton. |
| 19 class AppModalDialogQueue { | 21 class AppModalDialogQueue { |
| 20 public: | 22 public: |
| 21 typedef std::deque<AppModalDialog*>::iterator iterator; | 23 typedef std::deque<AppModalDialog*>::iterator iterator; |
| 22 | 24 |
| 23 // Returns the singleton instance. | 25 // Returns the singleton instance. |
| 24 static AppModalDialogQueue* GetInstance(); | 26 static AppModalDialogQueue* GetInstance(); |
| 25 | 27 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // active app-modal dialog box. | 81 // active app-modal dialog box. |
| 80 AppModalDialog* active_dialog_; | 82 AppModalDialog* active_dialog_; |
| 81 | 83 |
| 82 // Stores if |ShowModalDialog()| is currently being called on an app-modal | 84 // Stores if |ShowModalDialog()| is currently being called on an app-modal |
| 83 // dialog. | 85 // dialog. |
| 84 bool showing_modal_dialog_; | 86 bool showing_modal_dialog_; |
| 85 | 87 |
| 86 DISALLOW_COPY_AND_ASSIGN(AppModalDialogQueue); | 88 DISALLOW_COPY_AND_ASSIGN(AppModalDialogQueue); |
| 87 }; | 89 }; |
| 88 | 90 |
| 91 } // namespace app_modal_dialogs |
| 92 |
| 89 #endif // COMPONENTS_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ | 93 #endif // COMPONENTS_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ |
| OLD | NEW |