OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/cancelable_callback.h" | 12 #include "base/cancelable_callback.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/prefs/pref_change_registrar.h" | 16 #include "base/prefs/pref_change_registrar.h" |
17 #include "chrome/browser/devtools/device/android_device_manager.h" | 17 #include "chrome/browser/devtools/device/android_device_manager.h" |
18 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 18 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
19 #include "components/keyed_service/core/keyed_service.h" | 19 #include "components/keyed_service/core/keyed_service.h" |
20 #include "content/public/browser/devtools_agent_host.h" | 20 #include "content/public/browser/devtools_agent_host.h" |
21 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
22 | 22 |
| 23 namespace base { |
23 template<typename T> struct DefaultSingletonTraits; | 24 template<typename T> struct DefaultSingletonTraits; |
24 | 25 |
25 namespace base { | |
26 class MessageLoop; | 26 class MessageLoop; |
27 class DictionaryValue; | 27 class DictionaryValue; |
28 class ListValue; | 28 class ListValue; |
29 class Thread; | 29 class Thread; |
30 } | 30 } // namespace base |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 class BrowserContext; | 33 class BrowserContext; |
34 } | 34 } |
35 | 35 |
36 class DevToolsTargetImpl; | 36 class DevToolsTargetImpl; |
37 class PortForwardingController; | 37 class PortForwardingController; |
38 class Profile; | 38 class Profile; |
39 class WebRTCDeviceProvider; | 39 class WebRTCDeviceProvider; |
40 class SigninManagerBase; | 40 class SigninManagerBase; |
41 class ProfileOAuth2TokenService; | 41 class ProfileOAuth2TokenService; |
42 | 42 |
43 class DevToolsAndroidBridge : public KeyedService { | 43 class DevToolsAndroidBridge : public KeyedService { |
44 public: | 44 public: |
45 class Factory : public BrowserContextKeyedServiceFactory { | 45 class Factory : public BrowserContextKeyedServiceFactory { |
46 public: | 46 public: |
47 // Returns singleton instance of DevToolsAndroidBridge. | 47 // Returns singleton instance of DevToolsAndroidBridge. |
48 static Factory* GetInstance(); | 48 static Factory* GetInstance(); |
49 | 49 |
50 // Returns DevToolsAndroidBridge associated with |profile|. | 50 // Returns DevToolsAndroidBridge associated with |profile|. |
51 static DevToolsAndroidBridge* GetForProfile(Profile* profile); | 51 static DevToolsAndroidBridge* GetForProfile(Profile* profile); |
52 | 52 |
53 private: | 53 private: |
54 friend struct DefaultSingletonTraits<Factory>; | 54 friend struct base::DefaultSingletonTraits<Factory>; |
55 | 55 |
56 Factory(); | 56 Factory(); |
57 ~Factory() override; | 57 ~Factory() override; |
58 | 58 |
59 // BrowserContextKeyedServiceFactory overrides: | 59 // BrowserContextKeyedServiceFactory overrides: |
60 KeyedService* BuildServiceInstanceFor( | 60 KeyedService* BuildServiceInstanceFor( |
61 content::BrowserContext* context) const override; | 61 content::BrowserContext* context) const override; |
62 DISALLOW_COPY_AND_ASSIGN(Factory); | 62 DISALLOW_COPY_AND_ASSIGN(Factory); |
63 }; | 63 }; |
64 | 64 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 scoped_ptr<PortForwardingController> port_forwarding_controller_; | 298 scoped_ptr<PortForwardingController> port_forwarding_controller_; |
299 | 299 |
300 PrefChangeRegistrar pref_change_registrar_; | 300 PrefChangeRegistrar pref_change_registrar_; |
301 | 301 |
302 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_; | 302 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_; |
303 | 303 |
304 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); | 304 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); |
305 }; | 305 }; |
306 | 306 |
307 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 307 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
OLD | NEW |