| 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 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class Profile; | 37 class Profile; |
| 38 | 38 |
| 39 class DevToolsAndroidBridge | 39 class DevToolsAndroidBridge |
| 40 : public base::RefCountedThreadSafe< | 40 : public base::RefCountedThreadSafe< |
| 41 DevToolsAndroidBridge, | 41 DevToolsAndroidBridge, |
| 42 content::BrowserThread::DeleteOnUIThread> { | 42 content::BrowserThread::DeleteOnUIThread> { |
| 43 public: | 43 public: |
| 44 class Wrapper : public KeyedService { | 44 class Wrapper : public KeyedService { |
| 45 public: | 45 public: |
| 46 explicit Wrapper(content::BrowserContext* context); | 46 explicit Wrapper(content::BrowserContext* context); |
| 47 virtual ~Wrapper(); | 47 ~Wrapper() override; |
| 48 | 48 |
| 49 DevToolsAndroidBridge* Get(); | 49 DevToolsAndroidBridge* Get(); |
| 50 private: | 50 private: |
| 51 scoped_refptr<DevToolsAndroidBridge> bridge_; | 51 scoped_refptr<DevToolsAndroidBridge> bridge_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 class Factory : public BrowserContextKeyedServiceFactory { | 54 class Factory : public BrowserContextKeyedServiceFactory { |
| 55 public: | 55 public: |
| 56 // Returns singleton instance of DevToolsAndroidBridge. | 56 // Returns singleton instance of DevToolsAndroidBridge. |
| 57 static Factory* GetInstance(); | 57 static Factory* GetInstance(); |
| 58 | 58 |
| 59 // Returns DevToolsAndroidBridge associated with |profile|. | 59 // Returns DevToolsAndroidBridge associated with |profile|. |
| 60 static DevToolsAndroidBridge* GetForProfile(Profile* profile); | 60 static DevToolsAndroidBridge* GetForProfile(Profile* profile); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 friend struct DefaultSingletonTraits<Factory>; | 63 friend struct DefaultSingletonTraits<Factory>; |
| 64 | 64 |
| 65 Factory(); | 65 Factory(); |
| 66 virtual ~Factory(); | 66 ~Factory() override; |
| 67 | 67 |
| 68 // BrowserContextKeyedServiceFactory overrides: | 68 // BrowserContextKeyedServiceFactory overrides: |
| 69 virtual KeyedService* BuildServiceInstanceFor( | 69 KeyedService* BuildServiceInstanceFor( |
| 70 content::BrowserContext* context) const override; | 70 content::BrowserContext* context) const override; |
| 71 DISALLOW_COPY_AND_ASSIGN(Factory); | 71 DISALLOW_COPY_AND_ASSIGN(Factory); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 typedef std::pair<std::string, std::string> BrowserId; | 74 typedef std::pair<std::string, std::string> BrowserId; |
| 75 | 75 |
| 76 class RemotePage : public base::RefCounted<RemotePage> { | 76 class RemotePage : public base::RefCounted<RemotePage> { |
| 77 public: | 77 public: |
| 78 const std::string& serial() { return browser_id_.first; } | 78 const std::string& serial() { return browser_id_.first; } |
| 79 const std::string& socket() { return browser_id_.second; } | 79 const std::string& socket() { return browser_id_.second; } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 313 |
| 314 typedef std::vector<PortForwardingListener*> PortForwardingListeners; | 314 typedef std::vector<PortForwardingListener*> PortForwardingListeners; |
| 315 PortForwardingListeners port_forwarding_listeners_; | 315 PortForwardingListeners port_forwarding_listeners_; |
| 316 scoped_ptr<PortForwardingController> port_forwarding_controller_; | 316 scoped_ptr<PortForwardingController> port_forwarding_controller_; |
| 317 | 317 |
| 318 PrefChangeRegistrar pref_change_registrar_; | 318 PrefChangeRegistrar pref_change_registrar_; |
| 319 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); | 319 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); |
| 320 }; | 320 }; |
| 321 | 321 |
| 322 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 322 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
| OLD | NEW |