Roll src/third_party/WebKit a3b4a2e:7441784 (svn 202551:202552)
[chromium-blink-merge.git] / extensions / browser / api / system_info / system_info_api.h
blob6a2d2419dc61d9ca06af36928a9c08b4e146f0ca
1 // Copyright 2013 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 EXTENSIONS_BROWSER_API_SYSTEM_INFO_SYSTEM_INFO_API_H_
6 #define EXTENSIONS_BROWSER_API_SYSTEM_INFO_SYSTEM_INFO_API_H_
8 #include "extensions/browser/browser_context_keyed_api_factory.h"
9 #include "extensions/browser/event_router.h"
11 namespace extensions {
13 // A Profile-scoped object which is registered as an observer of EventRouter
14 // to observe the systemInfo event listener arrival/removal.
15 class SystemInfoAPI : public BrowserContextKeyedAPI,
16 public EventRouter::Observer {
17 public:
18 // BrowserContextKeyedAPI implementation.
19 static BrowserContextKeyedAPIFactory<SystemInfoAPI>* GetFactoryInstance();
21 explicit SystemInfoAPI(content::BrowserContext* context);
22 ~SystemInfoAPI() override;
24 // KeyedService implementation.
25 void Shutdown() override;
27 // EventRouter::Observer implementation.
28 void OnListenerAdded(const EventListenerInfo& details) override;
29 void OnListenerRemoved(const EventListenerInfo& details) override;
31 private:
32 friend class BrowserContextKeyedAPIFactory<SystemInfoAPI>;
34 // BrowserContextKeyedAPI implementation.
35 static const char* service_name() { return "SystemInfoAPI"; }
36 static const bool kServiceIsNULLWhileTesting = true;
38 content::BrowserContext* browser_context_;
40 DISALLOW_COPY_AND_ASSIGN(SystemInfoAPI);
43 } // namespace extensions
45 #endif // EXTENSIONS_BROWSER_API_SYSTEM_INFO_SYSTEM_INFO_API_H_