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_PROCESSES_PROCESSES_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PROCESSES_PROCESSES_API_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_PROCESSES_PROCESSES_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PROCESSES_PROCESSES_API_H__ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/extensions/chrome_extension_function.h" | 12 #include "chrome/browser/extensions/chrome_extension_function.h" |
13 #include "chrome/browser/task_manager/task_manager.h" | 13 #include "chrome/browser/task_manager/task_manager.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_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
16 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
17 #include "content/public/browser/render_widget_host.h" | 17 #include "content/public/browser/render_widget_host.h" |
18 #include "extensions/browser/browser_context_keyed_api_factory.h" | 18 #include "extensions/browser/browser_context_keyed_api_factory.h" |
19 #include "extensions/browser/event_router.h" | 19 #include "extensions/browser/event_router.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class ListValue; | 22 class ListValue; |
23 } | 23 } |
24 | 24 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 DISALLOW_COPY_AND_ASSIGN(ProcessesEventRouter); | 93 DISALLOW_COPY_AND_ASSIGN(ProcessesEventRouter); |
94 }; | 94 }; |
95 | 95 |
96 // The profile-keyed service that manages the processes extension API. | 96 // The profile-keyed service that manages the processes extension API. |
97 class ProcessesAPI : public BrowserContextKeyedAPI, | 97 class ProcessesAPI : public BrowserContextKeyedAPI, |
98 public EventRouter::Observer { | 98 public EventRouter::Observer { |
99 public: | 99 public: |
100 explicit ProcessesAPI(content::BrowserContext* context); | 100 explicit ProcessesAPI(content::BrowserContext* context); |
101 virtual ~ProcessesAPI(); | 101 virtual ~ProcessesAPI(); |
102 | 102 |
103 // BrowserContextKeyedService implementation. | 103 // KeyedService implementation. |
104 virtual void Shutdown() OVERRIDE; | 104 virtual void Shutdown() OVERRIDE; |
105 | 105 |
106 // BrowserContextKeyedAPI implementation. | 106 // BrowserContextKeyedAPI implementation. |
107 static BrowserContextKeyedAPIFactory<ProcessesAPI>* GetFactoryInstance(); | 107 static BrowserContextKeyedAPIFactory<ProcessesAPI>* GetFactoryInstance(); |
108 | 108 |
109 // Convenience method to get the ProcessesAPI for a profile. | 109 // Convenience method to get the ProcessesAPI for a profile. |
110 static ProcessesAPI* Get(content::BrowserContext* context); | 110 static ProcessesAPI* Get(content::BrowserContext* context); |
111 | 111 |
112 ProcessesEventRouter* processes_event_router(); | 112 ProcessesEventRouter* processes_event_router(); |
113 | 113 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 bool memory_; | 191 bool memory_; |
192 #endif | 192 #endif |
193 | 193 |
194 DECLARE_EXTENSION_FUNCTION("processes.getProcessInfo", | 194 DECLARE_EXTENSION_FUNCTION("processes.getProcessInfo", |
195 PROCESSES_GETPROCESSINFO) | 195 PROCESSES_GETPROCESSINFO) |
196 }; | 196 }; |
197 | 197 |
198 } // namespace extensions | 198 } // namespace extensions |
199 | 199 |
200 #endif // CHROME_BROWSER_EXTENSIONS_API_PROCESSES_PROCESSES_API_H__ | 200 #endif // CHROME_BROWSER_EXTENSIONS_API_PROCESSES_PROCESSES_API_H__ |
OLD | NEW |