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

Side by Side Diff: chrome/browser/ui/global_error/global_error_service.h

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_SERVICE_H_ 5 #ifndef CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_SERVICE_H_
6 #define CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_SERVICE_H_ 6 #define CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "components/keyed_service/core/keyed_service.h" 11 #include "components/keyed_service/core/keyed_service.h"
12 12
13 class GlobalError; 13 class GlobalError;
14 class Profile; 14 class Profile;
15 15
16 // This service manages a list of errors that are meant to be shown globally. 16 // This service manages a list of errors that are meant to be shown globally.
17 // If an error applies to an entire profile and not just to a tab then the 17 // If an error applies to an entire profile and not just to a tab then the
18 // error should be shown using this service. Examples of global errors are: 18 // error should be shown using this service. Examples of global errors are:
19 // - the previous session crashed for a given profile. 19 // - the previous session crashed for a given profile.
20 // - a sync error occurred 20 // - a sync error occurred
21 class GlobalErrorService : public KeyedService { 21 class GlobalErrorService : public KeyedService {
22 public: 22 public:
23 // Type used to represent the list of currently active errors. 23 // Type used to represent the list of currently active errors.
24 typedef std::vector<GlobalError*> GlobalErrorList; 24 typedef std::vector<GlobalError*> GlobalErrorList;
25 25
26 // Constructs a GlobalErrorService object for the given profile. The profile 26 // Constructs a GlobalErrorService object for the given profile. The profile
27 // maybe NULL for tests. 27 // maybe NULL for tests.
28 explicit GlobalErrorService(Profile* profile); 28 explicit GlobalErrorService(Profile* profile);
29 virtual ~GlobalErrorService(); 29 ~GlobalErrorService() override;
30 30
31 // Adds the given error to the list of global errors and displays it on 31 // Adds the given error to the list of global errors and displays it on
32 // browswer windows. If no browser windows are open then the error is 32 // browswer windows. If no browser windows are open then the error is
33 // displayed once a browser window is opened. This class takes ownership of 33 // displayed once a browser window is opened. This class takes ownership of
34 // the error. 34 // the error.
35 void AddGlobalError(GlobalError* error); 35 void AddGlobalError(GlobalError* error);
36 36
37 // Hides the given error and removes it from the list of global errors. Caller 37 // Hides the given error and removes it from the list of global errors. Caller
38 // then takes ownership of the error and is responsible for deleting it. 38 // then takes ownership of the error and is responsible for deleting it.
39 void RemoveGlobalError(GlobalError* error); 39 void RemoveGlobalError(GlobalError* error);
(...skipping 19 matching lines...) Expand all
59 void NotifyErrorsChanged(GlobalError* error); 59 void NotifyErrorsChanged(GlobalError* error);
60 60
61 private: 61 private:
62 GlobalErrorList errors_; 62 GlobalErrorList errors_;
63 Profile* profile_; 63 Profile* profile_;
64 64
65 DISALLOW_COPY_AND_ASSIGN(GlobalErrorService); 65 DISALLOW_COPY_AND_ASSIGN(GlobalErrorService);
66 }; 66 };
67 67
68 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_SERVICE_H_ 68 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698