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 #include "chrome/browser/devtools/device/port_forwarding_controller.h" | 5 #include "chrome/browser/devtools/device/port_forwarding_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 567 |
568 for (DevToolsAndroidBridge::RemoteDevices::const_iterator it = | 568 for (DevToolsAndroidBridge::RemoteDevices::const_iterator it = |
569 devices.begin(); it != devices.end(); ++it) { | 569 devices.begin(); it != devices.end(); ++it) { |
570 scoped_refptr<DevToolsAndroidBridge::RemoteDevice> device = *it; | 570 scoped_refptr<DevToolsAndroidBridge::RemoteDevice> device = *it; |
571 if (!device->is_connected()) | 571 if (!device->is_connected()) |
572 continue; | 572 continue; |
573 Registry::iterator rit = registry_.find(device->serial()); | 573 Registry::iterator rit = registry_.find(device->serial()); |
574 if (rit == registry_.end()) { | 574 if (rit == registry_.end()) { |
575 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> browser = | 575 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> browser = |
576 FindBestBrowserForTethering(device->browsers()); | 576 FindBestBrowserForTethering(device->browsers()); |
577 if (browser) { | 577 if (browser.get()) { |
578 new Connection(®istry_, device, browser, forwarding_map_); | 578 new Connection(®istry_, device, browser, forwarding_map_); |
579 } | 579 } |
580 } else { | 580 } else { |
581 status[device->serial()] = (*rit).second->GetPortStatusMap(); | 581 status[device->serial()] = (*rit).second->GetPortStatusMap(); |
582 } | 582 } |
583 } | 583 } |
584 | 584 |
585 NotifyListeners(status); | 585 NotifyListeners(status); |
586 } | 586 } |
587 | 587 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 "PortForwardingController", | 668 "PortForwardingController", |
669 BrowserContextDependencyManager::GetInstance()) {} | 669 BrowserContextDependencyManager::GetInstance()) {} |
670 | 670 |
671 PortForwardingController::Factory::~Factory() {} | 671 PortForwardingController::Factory::~Factory() {} |
672 | 672 |
673 KeyedService* PortForwardingController::Factory::BuildServiceInstanceFor( | 673 KeyedService* PortForwardingController::Factory::BuildServiceInstanceFor( |
674 content::BrowserContext* context) const { | 674 content::BrowserContext* context) const { |
675 Profile* profile = Profile::FromBrowserContext(context); | 675 Profile* profile = Profile::FromBrowserContext(context); |
676 return new PortForwardingController(profile); | 676 return new PortForwardingController(profile); |
677 } | 677 } |
OLD | NEW |