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 CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/threading/non_thread_safe.h" | |
11 #include "components/keyed_service/core/keyed_service.h" | 10 #include "components/keyed_service/core/keyed_service.h" |
12 #include "extensions/browser/warning_service.h" | 11 #include "extensions/browser/warning_service.h" |
13 #include "extensions/browser/warning_set.h" | 12 #include "extensions/browser/warning_set.h" |
14 | 13 |
15 class Profile; | 14 class Profile; |
16 | 15 |
17 namespace extensions { | 16 namespace extensions { |
18 | 17 |
19 // A service that is responsible for showing an extension warning badge on the | 18 // A service that is responsible for showing an extension warning badge on the |
20 // wrench menu. | 19 // wrench menu. |
21 class WarningBadgeService : public KeyedService, | 20 class WarningBadgeService : public KeyedService, |
22 public WarningService::Observer, | 21 public WarningService::Observer { |
23 public base::NonThreadSafe { | |
24 public: | 22 public: |
25 explicit WarningBadgeService(Profile* profile); | 23 explicit WarningBadgeService(Profile* profile); |
26 ~WarningBadgeService() override; | 24 ~WarningBadgeService() override; |
27 | 25 |
28 static WarningBadgeService* Get(content::BrowserContext* context); | 26 static WarningBadgeService* Get(content::BrowserContext* context); |
29 | 27 |
30 // Black lists all currently active extension warnings, so that they do not | 28 // Black lists all currently active extension warnings, so that they do not |
31 // trigger a warning badge again for the life-time of the browsing session. | 29 // trigger a warning badge again for the life-time of the browsing session. |
32 void SuppressCurrentWarnings(); | 30 void SuppressCurrentWarnings(); |
33 | 31 |
(...skipping 16 matching lines...) Expand all Loading... |
50 | 48 |
51 // Warnings that do not trigger a badge on the wrench menu. | 49 // Warnings that do not trigger a badge on the wrench menu. |
52 WarningSet suppressed_warnings_; | 50 WarningSet suppressed_warnings_; |
53 | 51 |
54 DISALLOW_COPY_AND_ASSIGN(WarningBadgeService); | 52 DISALLOW_COPY_AND_ASSIGN(WarningBadgeService); |
55 }; | 53 }; |
56 | 54 |
57 } // namespace extensions | 55 } // namespace extensions |
58 | 56 |
59 #endif // CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_ | 57 #endif // CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_ |
OLD | NEW |