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

Side by Side Diff: components/app_modal/app_modal_dialog_queue.h

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
« no previous file with comments | « chromeos/system/statistics_provider.cc ('k') | components/app_modal/app_modal_dialog_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_APP_MODAL_DIALOG_QUEUE_H_ 5 #ifndef COMPONENTS_APP_MODAL_APP_MODAL_DIALOG_QUEUE_H_
6 #define COMPONENTS_APP_MODAL_APP_MODAL_DIALOG_QUEUE_H_ 6 #define COMPONENTS_APP_MODAL_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 namespace base {
12 template <typename T> struct DefaultSingletonTraits; 13 template <typename T> struct DefaultSingletonTraits;
14 }
13 15
14 namespace app_modal { 16 namespace app_modal {
15 17
16 class AppModalDialog; 18 class AppModalDialog;
17 19
18 // Keeps a queue of AppModalDialogs, making sure only one app modal 20 // Keeps a queue of AppModalDialogs, making sure only one app modal
19 // dialog is shown at a time. 21 // dialog is shown at a time.
20 // This class is a singleton. 22 // This class is a singleton.
21 class AppModalDialogQueue { 23 class AppModalDialogQueue {
22 public: 24 public:
(...skipping 29 matching lines...) Expand all
52 bool HasActiveDialog() const; 54 bool HasActiveDialog() const;
53 55
54 AppModalDialog* active_dialog() { return active_dialog_; } 56 AppModalDialog* active_dialog() { return active_dialog_; }
55 57
56 // Iterators to walk the queue. The queue does not include the currently 58 // Iterators to walk the queue. The queue does not include the currently
57 // active app modal dialog box. 59 // active app modal dialog box.
58 iterator begin() { return app_modal_dialog_queue_.begin(); } 60 iterator begin() { return app_modal_dialog_queue_.begin(); }
59 iterator end() { return app_modal_dialog_queue_.end(); } 61 iterator end() { return app_modal_dialog_queue_.end(); }
60 62
61 private: 63 private:
62 friend struct DefaultSingletonTraits<AppModalDialogQueue>; 64 friend struct base::DefaultSingletonTraits<AppModalDialogQueue>;
63 65
64 AppModalDialogQueue(); 66 AppModalDialogQueue();
65 ~AppModalDialogQueue(); 67 ~AppModalDialogQueue();
66 68
67 // Shows |dialog| and notifies the BrowserList that a modal dialog is showing. 69 // Shows |dialog| and notifies the BrowserList that a modal dialog is showing.
68 void ShowModalDialog(AppModalDialog* dialog); 70 void ShowModalDialog(AppModalDialog* dialog);
69 71
70 // Returns the next dialog to show. This removes entries from 72 // Returns the next dialog to show. This removes entries from
71 // app_modal_dialog_queue_ until one is valid or the queue is empty. This 73 // app_modal_dialog_queue_ until one is valid or the queue is empty. This
72 // returns NULL if there are no more dialogs, or all the dialogs in the queue 74 // returns NULL if there are no more dialogs, or all the dialogs in the queue
(...skipping 11 matching lines...) Expand all
84 // Stores if |ShowModalDialog()| is currently being called on an app-modal 86 // Stores if |ShowModalDialog()| is currently being called on an app-modal
85 // dialog. 87 // dialog.
86 bool showing_modal_dialog_; 88 bool showing_modal_dialog_;
87 89
88 DISALLOW_COPY_AND_ASSIGN(AppModalDialogQueue); 90 DISALLOW_COPY_AND_ASSIGN(AppModalDialogQueue);
89 }; 91 };
90 92
91 } // namespace app_modal 93 } // namespace app_modal
92 94
93 #endif // COMPONENTS_APP_MODAL_APP_MODAL_DIALOG_QUEUE_H_ 95 #endif // COMPONENTS_APP_MODAL_APP_MODAL_DIALOG_QUEUE_H_
OLDNEW
« no previous file with comments | « chromeos/system/statistics_provider.cc ('k') | components/app_modal/app_modal_dialog_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698