Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: chrome/browser/devtools/port_forwarding_controller.cc

Issue 26436003: DevTools: display 'Pending authentication' message upon raw usb debugging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/devtools/port_forwarding_controller.h" 5 #include "chrome/browser/devtools/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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 it->second->Shutdown(); 588 it->second->Shutdown();
589 } 589 }
590 590
591 PortForwardingController::DevicesStatus 591 PortForwardingController::DevicesStatus
592 PortForwardingController::UpdateDeviceList( 592 PortForwardingController::UpdateDeviceList(
593 const DevToolsAdbBridge::RemoteDevices& devices) { 593 const DevToolsAdbBridge::RemoteDevices& devices) {
594 DevicesStatus status; 594 DevicesStatus status;
595 for (DevToolsAdbBridge::RemoteDevices::const_iterator it = devices.begin(); 595 for (DevToolsAdbBridge::RemoteDevices::const_iterator it = devices.begin();
596 it != devices.end(); ++it) { 596 it != devices.end(); ++it) {
597 scoped_refptr<DevToolsAdbBridge::RemoteDevice> device = *it; 597 scoped_refptr<DevToolsAdbBridge::RemoteDevice> device = *it;
598 Registry::iterator rit = registry_.find(device->serial()); 598 Registry::iterator rit = registry_.find(device->GetSerial());
Vladislav Kaznacheev 2013/10/08 16:42:37 How about adding device->IsConnected check and not
pfeldman 2013/10/08 17:11:04 Yep, thanks.
599 if (rit == registry_.end()) { 599 if (rit == registry_.end()) {
600 std::string socket = FindBestSocketForTethering(device->browsers()); 600 std::string socket = FindBestSocketForTethering(device->browsers());
601 if (!socket.empty() || device->serial().empty()) { 601 if (!socket.empty() || device->GetSerial().empty()) {
602 // Will delete itself when disconnected. 602 // Will delete itself when disconnected.
603 new Connection( 603 new Connection(
604 &registry_, device->device(), socket, adb_thread_, pref_service_); 604 &registry_, device->device(), socket, adb_thread_, pref_service_);
605 } 605 }
606 } else { 606 } else {
607 status[device->serial()] = (*rit).second->GetPortStatusMap(); 607 status[device->GetSerial()] = (*rit).second->GetPortStatusMap();
608 } 608 }
609 } 609 }
610 return status; 610 return status;
611 } 611 }
612 612
613 // static 613 // static
614 PortForwardingController::Factory* 614 PortForwardingController::Factory*
615 PortForwardingController::Factory::GetInstance() { 615 PortForwardingController::Factory::GetInstance() {
616 return Singleton<PortForwardingController::Factory>::get(); 616 return Singleton<PortForwardingController::Factory>::get();
617 } 617 }
(...skipping 11 matching lines...) Expand all
629 BrowserContextDependencyManager::GetInstance()) {} 629 BrowserContextDependencyManager::GetInstance()) {}
630 630
631 PortForwardingController::Factory::~Factory() {} 631 PortForwardingController::Factory::~Factory() {}
632 632
633 BrowserContextKeyedService* 633 BrowserContextKeyedService*
634 PortForwardingController::Factory::BuildServiceInstanceFor( 634 PortForwardingController::Factory::BuildServiceInstanceFor(
635 content::BrowserContext* context) const { 635 content::BrowserContext* context) const {
636 Profile* profile = Profile::FromBrowserContext(context); 636 Profile* profile = Profile::FromBrowserContext(context);
637 return new PortForwardingController(profile->GetPrefs()); 637 return new PortForwardingController(profile->GetPrefs());
638 } 638 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_adb_bridge.cc ('k') | chrome/browser/resources/inspect/inspect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698