| 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_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "chrome/browser/extensions/extension_action_icon_factory.h" | 13 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
| 14 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 14 #include "components/keyed_service/core/keyed_service.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "extensions/browser/event_router.h" | 17 #include "extensions/browser/event_router.h" |
| 18 | 18 |
| 19 class ExtensionAction; | 19 class ExtensionAction; |
| 20 class Profile; | 20 class Profile; |
| 21 class StatusTray; | 21 class StatusTray; |
| 22 | 22 |
| 23 FORWARD_DECLARE_TEST(SystemIndicatorApiTest, SystemIndicator); | 23 FORWARD_DECLARE_TEST(SystemIndicatorApiTest, SystemIndicator); |
| 24 | 24 |
| 25 namespace extensions { | 25 namespace extensions { |
| 26 | 26 |
| 27 class ExtensionIndicatorIcon; | 27 class ExtensionIndicatorIcon; |
| 28 | 28 |
| 29 // Keeps track of all the systemIndicator icons created for a given Profile | 29 // Keeps track of all the systemIndicator icons created for a given Profile |
| 30 // that are currently visible in the UI. Use SystemIndicatorManagerFactory to | 30 // that are currently visible in the UI. Use SystemIndicatorManagerFactory to |
| 31 // create a SystemIndicatorManager object. | 31 // create a SystemIndicatorManager object. |
| 32 class SystemIndicatorManager : public content::NotificationObserver, | 32 class SystemIndicatorManager : public content::NotificationObserver, |
| 33 public BrowserContextKeyedService { | 33 public KeyedService { |
| 34 public: | 34 public: |
| 35 SystemIndicatorManager(Profile* profile, StatusTray* status_tray); | 35 SystemIndicatorManager(Profile* profile, StatusTray* status_tray); |
| 36 virtual ~SystemIndicatorManager(); | 36 virtual ~SystemIndicatorManager(); |
| 37 | 37 |
| 38 // BrowserContextKeyedService implementation. | 38 // KeyedService implementation. |
| 39 virtual void Shutdown() OVERRIDE; | 39 virtual void Shutdown() OVERRIDE; |
| 40 | 40 |
| 41 // content::NotificationDelegate implementation. | 41 // content::NotificationDelegate implementation. |
| 42 virtual void Observe(int type, | 42 virtual void Observe(int type, |
| 43 const content::NotificationSource& source, | 43 const content::NotificationSource& source, |
| 44 const content::NotificationDetails& details) OVERRIDE; | 44 const content::NotificationDetails& details) OVERRIDE; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 FRIEND_TEST_ALL_PREFIXES(::SystemIndicatorApiTest, SystemIndicator); | 47 FRIEND_TEST_ALL_PREFIXES(::SystemIndicatorApiTest, SystemIndicator); |
| 48 | 48 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 71 SystemIndicatorMap system_indicators_; | 71 SystemIndicatorMap system_indicators_; |
| 72 content::NotificationRegistrar registrar_; | 72 content::NotificationRegistrar registrar_; |
| 73 base::ThreadChecker thread_checker_; | 73 base::ThreadChecker thread_checker_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(SystemIndicatorManager); | 75 DISALLOW_COPY_AND_ASSIGN(SystemIndicatorManager); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace extensions | 78 } // namespace extensions |
| 79 | 79 |
| 80 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAG
ER_H_ | 80 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAG
ER_H_ |
| OLD | NEW |