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

Side by Side Diff: chrome/browser/extensions/warning_badge_service.h

Issue 2912003002: Replace deprecated base::NonThreadSafe in chrome/browser/extensions in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | chrome/browser/extensions/warning_badge_service.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 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" 10 #include "base/sequence_checker.h"
11 #include "components/keyed_service/core/keyed_service.h" 11 #include "components/keyed_service/core/keyed_service.h"
12 #include "extensions/browser/warning_service.h" 12 #include "extensions/browser/warning_service.h"
13 #include "extensions/browser/warning_set.h" 13 #include "extensions/browser/warning_set.h"
14 14
15 class Profile; 15 class Profile;
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 // A service that is responsible for showing an extension warning badge on the 19 // A service that is responsible for showing an extension warning badge on the
20 // wrench menu. 20 // wrench menu.
21 class WarningBadgeService : public KeyedService, 21 class WarningBadgeService : public KeyedService,
22 public WarningService::Observer, 22 public WarningService::Observer {
23 public base::NonThreadSafe {
24 public: 23 public:
25 explicit WarningBadgeService(Profile* profile); 24 explicit WarningBadgeService(Profile* profile);
26 ~WarningBadgeService() override; 25 ~WarningBadgeService() override;
27 26
28 static WarningBadgeService* Get(content::BrowserContext* context); 27 static WarningBadgeService* Get(content::BrowserContext* context);
29 28
30 // Black lists all currently active extension warnings, so that they do not 29 // 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. 30 // trigger a warning badge again for the life-time of the browsing session.
32 void SuppressCurrentWarnings(); 31 void SuppressCurrentWarnings();
33 32
(...skipping 10 matching lines...) Expand all
44 virtual void ShowBadge(bool show); 43 virtual void ShowBadge(bool show);
45 44
46 Profile* profile_; 45 Profile* profile_;
47 46
48 ScopedObserver<WarningService, WarningService::Observer> 47 ScopedObserver<WarningService, WarningService::Observer>
49 warning_service_observer_; 48 warning_service_observer_;
50 49
51 // Warnings that do not trigger a badge on the wrench menu. 50 // Warnings that do not trigger a badge on the wrench menu.
52 WarningSet suppressed_warnings_; 51 WarningSet suppressed_warnings_;
53 52
53 SEQUENCE_CHECKER(sequence_checker_);
Devlin 2017/05/30 20:04:25 This class should only ever be used on the UI thre
gab 2017/05/31 16:36:24 Done.
54
54 DISALLOW_COPY_AND_ASSIGN(WarningBadgeService); 55 DISALLOW_COPY_AND_ASSIGN(WarningBadgeService);
55 }; 56 };
56 57
57 } // namespace extensions 58 } // namespace extensions
58 59
59 #endif // CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_ 60 #endif // CHROME_BROWSER_EXTENSIONS_WARNING_BADGE_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/warning_badge_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698