Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / extensions / extension_warning_badge_service.h
blob461bc5c6bf931b4a4f2f1e8ca593cfa3dac411a6
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_BADGE_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_BADGE_SERVICE_H_
8 #include "base/compiler_specific.h"
9 #include "base/threading/non_thread_safe.h"
10 #include "chrome/browser/extensions/extension_warning_service.h"
11 #include "chrome/browser/extensions/extension_warning_set.h"
13 // TODO(battre): Rename ExtensionWarningBadgeService to WarningBadgeService.
15 class Profile;
17 namespace extensions {
19 // A service that is responsible for showing an extension warning badge on the
20 // wrench menu.
21 class ExtensionWarningBadgeService : public ExtensionWarningService::Observer,
22 public base::NonThreadSafe {
23 public:
24 explicit ExtensionWarningBadgeService(Profile* profile);
25 virtual ~ExtensionWarningBadgeService();
27 // Black lists all currently active extension warnings, so that they do not
28 // trigger a warning badge again for the life-time of the browsing session.
29 void SuppressCurrentWarnings();
31 protected:
32 // Virtual for testing.
33 virtual const std::set<ExtensionWarning>& GetCurrentWarnings() const;
35 private:
36 // Implementation of ExtensionWarningService::Observer.
37 virtual void ExtensionWarningsChanged() OVERRIDE;
39 void UpdateBadgeStatus();
40 virtual void ShowBadge(bool show);
42 Profile* profile_;
44 // Warnings that do not trigger a badge on the wrench menu.
45 ExtensionWarningSet suppressed_warnings_;
47 DISALLOW_COPY_AND_ASSIGN(ExtensionWarningBadgeService);
50 } // namespace extensions
52 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_BADGE_SERVICE_H_