OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_LOG_PRIVATE_LOG_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/extensions/api/log_private/filter_handler.h" | 11 #include "chrome/browser/extensions/api/log_private/filter_handler.h" |
12 #include "chrome/browser/extensions/api/log_private/log_parser.h" | 12 #include "chrome/browser/extensions/api/log_private/log_parser.h" |
13 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 13 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
14 #include "chrome/browser/extensions/chrome_extension_function.h" | 14 #include "chrome/browser/extensions/chrome_extension_function.h" |
15 #include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h" | 15 #include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h" |
16 #include "chrome/common/extensions/api/log_private.h" | 16 #include "chrome/common/extensions/api/log_private.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 #include "net/base/net_log.h" | 19 #include "net/base/net_log.h" |
20 | 20 |
21 class Profile; | 21 class Profile; |
22 | 22 |
| 23 namespace content { |
| 24 class BrowserContext; |
| 25 } |
| 26 |
23 namespace extensions { | 27 namespace extensions { |
24 | 28 |
25 class LogPrivateAPI : public ProfileKeyedAPI, | 29 class LogPrivateAPI : public ProfileKeyedAPI, |
26 public content::NotificationObserver, | 30 public content::NotificationObserver, |
27 public net::NetLog::ThreadSafeObserver { | 31 public net::NetLog::ThreadSafeObserver { |
28 public: | 32 public: |
29 // Convenience method to get the LogPrivateAPI for a profile. | 33 // Convenience method to get the LogPrivateAPI for a profile. |
30 static LogPrivateAPI* Get(Profile* profile); | 34 static LogPrivateAPI* Get(content::BrowserContext* context); |
31 | 35 |
32 explicit LogPrivateAPI(Profile* profile); | 36 explicit LogPrivateAPI(content::BrowserContext* context); |
33 virtual ~LogPrivateAPI(); | 37 virtual ~LogPrivateAPI(); |
34 | 38 |
35 void StartNetInternalsWatch(const std::string& extension_id); | 39 void StartNetInternalsWatch(const std::string& extension_id); |
36 void StopNetInternalsWatch(const std::string& extension_id); | 40 void StopNetInternalsWatch(const std::string& extension_id); |
37 | 41 |
38 // ProfileKeyedAPI implementation. | 42 // ProfileKeyedAPI implementation. |
39 static ProfileKeyedAPIFactory<LogPrivateAPI>* GetFactoryInstance(); | 43 static ProfileKeyedAPIFactory<LogPrivateAPI>* GetFactoryInstance(); |
40 | 44 |
41 // content::NotificationObserver implementation. | 45 // content::NotificationObserver implementation. |
42 virtual void Observe(int type, | 46 virtual void Observe(int type, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual ~LogPrivateStopNetInternalsWatchFunction(); | 118 virtual ~LogPrivateStopNetInternalsWatchFunction(); |
115 virtual bool RunImpl() OVERRIDE; | 119 virtual bool RunImpl() OVERRIDE; |
116 | 120 |
117 private: | 121 private: |
118 DISALLOW_COPY_AND_ASSIGN(LogPrivateStopNetInternalsWatchFunction); | 122 DISALLOW_COPY_AND_ASSIGN(LogPrivateStopNetInternalsWatchFunction); |
119 }; | 123 }; |
120 | 124 |
121 } // namespace extensions | 125 } // namespace extensions |
122 | 126 |
123 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ | 127 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ |
OLD | NEW |