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

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

Issue 318973002: DevTools: Allow using test shell apps for port forwarding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 static scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> 236 static scoped_refptr<DevToolsAndroidBridge::RemoteBrowser>
237 FindBestBrowserForTethering( 237 FindBestBrowserForTethering(
238 const DevToolsAndroidBridge::RemoteBrowsers browsers) { 238 const DevToolsAndroidBridge::RemoteBrowsers browsers) {
239 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> best_browser; 239 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> best_browser;
240 ParsedVersion newest_version; 240 ParsedVersion newest_version;
241 for (DevToolsAndroidBridge::RemoteBrowsers::const_iterator it = 241 for (DevToolsAndroidBridge::RemoteBrowsers::const_iterator it =
242 browsers.begin(); it != browsers.end(); ++it) { 242 browsers.begin(); it != browsers.end(); ++it) {
243 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> browser = *it; 243 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> browser = *it;
244 ParsedVersion current_version = browser->GetParsedVersion(); 244 ParsedVersion current_version = browser->GetParsedVersion();
245 if (browser->IsChrome() && 245 if (IsPortForwardingSupported(current_version) &&
246 IsPortForwardingSupported(current_version) &&
247 IsVersionLower(newest_version, current_version)) { 246 IsVersionLower(newest_version, current_version)) {
248 best_browser = browser; 247 best_browser = browser;
249 newest_version = current_version; 248 newest_version = current_version;
250 } 249 }
251 } 250 }
252 return best_browser; 251 return best_browser;
253 } 252 }
254 253
255 } // namespace 254 } // namespace
256 255
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 "PortForwardingController", 668 "PortForwardingController",
670 BrowserContextDependencyManager::GetInstance()) {} 669 BrowserContextDependencyManager::GetInstance()) {}
671 670
672 PortForwardingController::Factory::~Factory() {} 671 PortForwardingController::Factory::~Factory() {}
673 672
674 KeyedService* PortForwardingController::Factory::BuildServiceInstanceFor( 673 KeyedService* PortForwardingController::Factory::BuildServiceInstanceFor(
675 content::BrowserContext* context) const { 674 content::BrowserContext* context) const {
676 Profile* profile = Profile::FromBrowserContext(context); 675 Profile* profile = Profile::FromBrowserContext(context);
677 return new PortForwardingController(profile); 676 return new PortForwardingController(profile);
678 } 677 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698