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

Side by Side Diff: chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ 5 #ifndef CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_
6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ 6 #define CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <queue> 9 #include <queue>
10 10
11 #include "base/singleton.h" 11 #include "base/singleton.h"
joth 2010/12/08 17:15:07 remove?
12 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" 12 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
13 13
14 // Keeps a queue of AppModalDialogs, making sure only one app modal 14 // Keeps a queue of AppModalDialogs, making sure only one app modal
15 // dialog is shown at a time. 15 // dialog is shown at a time.
16 // This class is a singleton. 16 // This class is a singleton.
17 class AppModalDialogQueue { 17 class AppModalDialogQueue {
18 public: 18 public:
19 // Returns the singleton instance.
20 static AppModalDialogQueue* GetInstance();
21
19 // Adds a modal dialog to the queue, if there are no other dialogs in the 22 // Adds a modal dialog to the queue, if there are no other dialogs in the
20 // queue, the dialog will be shown immediately. Once it is shown, the 23 // queue, the dialog will be shown immediately. Once it is shown, the
21 // most recently active browser window (or whichever is currently active) 24 // most recently active browser window (or whichever is currently active)
22 // will be app modal, meaning it will be activated if the user tries to 25 // will be app modal, meaning it will be activated if the user tries to
23 // activate any other browser windows. So the dialog being shown should 26 // activate any other browser windows. So the dialog being shown should
24 // assure it is the child of BrowserList::GetLastActive() so that it is 27 // assure it is the child of BrowserList::GetLastActive() so that it is
25 // activated as well. See browser_list.h for more notes about our somewhat 28 // activated as well. See browser_list.h for more notes about our somewhat
26 // sloppy app modality. 29 // sloppy app modality.
27 // Note: The AppModalDialog |dialog| must be window modal before it 30 // Note: The AppModalDialog |dialog| must be window modal before it
28 // can be added as app modal. 31 // can be added as app modal.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 AppModalDialog* active_dialog_; 79 AppModalDialog* active_dialog_;
77 80
78 // Stores if |ShowModalDialog()| is currently being called on an app-modal 81 // Stores if |ShowModalDialog()| is currently being called on an app-modal
79 // dialog. 82 // dialog.
80 bool showing_modal_dialog_; 83 bool showing_modal_dialog_;
81 84
82 DISALLOW_COPY_AND_ASSIGN(AppModalDialogQueue); 85 DISALLOW_COPY_AND_ASSIGN(AppModalDialogQueue);
83 }; 86 };
84 87
85 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_ 88 #endif // CHROME_BROWSER_UI_APP_MODAL_DIALOGS_APP_MODAL_DIALOG_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698