| 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/keyed_service/core/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 #include "extensions/browser/extension_event_histogram_value.h" |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 class ListValue; | 23 class ListValue; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| 26 class BrowserContext; | 27 class BrowserContext; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace extensions { | 30 namespace extensions { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void OnItemsChanged(int start, int length) override; | 62 void OnItemsChanged(int start, int length) override; |
| 62 void OnItemsRemoved(int start, int length) override {} | 63 void OnItemsRemoved(int start, int length) override {} |
| 63 void OnItemsToBeRemoved(int start, int length) override; | 64 void OnItemsToBeRemoved(int start, int length) override; |
| 64 | 65 |
| 65 // Internal helpers for processing notifications. | 66 // Internal helpers for processing notifications. |
| 66 void ProcessHangEvent(content::RenderWidgetHost* widget); | 67 void ProcessHangEvent(content::RenderWidgetHost* widget); |
| 67 void ProcessClosedEvent( | 68 void ProcessClosedEvent( |
| 68 content::RenderProcessHost* rph, | 69 content::RenderProcessHost* rph, |
| 69 content::RenderProcessHost::RendererClosedDetails* details); | 70 content::RenderProcessHost::RendererClosedDetails* details); |
| 70 | 71 |
| 71 void DispatchEvent(const std::string& event_name, | 72 void DispatchEvent(events::HistogramValue histogram_value, |
| 73 const std::string& event_name, |
| 72 scoped_ptr<base::ListValue> event_args); | 74 scoped_ptr<base::ListValue> event_args); |
| 73 | 75 |
| 74 // Determines whether there is a registered listener for the specified event. | 76 // Determines whether there is a registered listener for the specified event. |
| 75 // It helps to avoid collecing data if no one is interested in it. | 77 // It helps to avoid collecing data if no one is interested in it. |
| 76 bool HasEventListeners(const std::string& event_name); | 78 bool HasEventListeners(const std::string& event_name); |
| 77 | 79 |
| 78 // Used for tracking registrations to process related notifications. | 80 // Used for tracking registrations to process related notifications. |
| 79 content::NotificationRegistrar registrar_; | 81 content::NotificationRegistrar registrar_; |
| 80 | 82 |
| 81 content::BrowserContext* browser_context_; | 83 content::BrowserContext* browser_context_; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 bool memory_; | 192 bool memory_; |
| 191 #endif | 193 #endif |
| 192 | 194 |
| 193 DECLARE_EXTENSION_FUNCTION("processes.getProcessInfo", | 195 DECLARE_EXTENSION_FUNCTION("processes.getProcessInfo", |
| 194 PROCESSES_GETPROCESSINFO) | 196 PROCESSES_GETPROCESSINFO) |
| 195 }; | 197 }; |
| 196 | 198 |
| 197 } // namespace extensions | 199 } // namespace extensions |
| 198 | 200 |
| 199 #endif // CHROME_BROWSER_EXTENSIONS_API_PROCESSES_PROCESSES_API_H__ | 201 #endif // CHROME_BROWSER_EXTENSIONS_API_PROCESSES_PROCESSES_API_H__ |
| OLD | NEW |