| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/android/dev_tools_server.h" | 5 #include "chrome/browser/android/dev_tools_server.h" |
| 6 | 6 |
| 7 #include <pwd.h> | 7 #include <pwd.h> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 | 9 |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 web_contents)); | 339 web_contents)); |
| 340 } else { | 340 } else { |
| 341 targets.push_back(TabTarget::CreateForUnloadedTab(tab->GetAndroidId(), | 341 targets.push_back(TabTarget::CreateForUnloadedTab(tab->GetAndroidId(), |
| 342 tab->GetTitle(), | 342 tab->GetTitle(), |
| 343 tab->GetURL())); | 343 tab->GetURL())); |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 | 347 |
| 348 // Add targets for WebContents not associated with any tabs. | 348 // Add targets for WebContents not associated with any tabs. |
| 349 std::vector<RenderViewHost*> rvh_list = | 349 std::vector<WebContents*> wc_list = |
| 350 DevToolsAgentHost::GetValidRenderViewHosts(); | 350 DevToolsAgentHost::GetInspectableWebContents(); |
| 351 for (std::vector<RenderViewHost*>::iterator it = rvh_list.begin(); | 351 for (std::vector<WebContents*>::iterator it = wc_list.begin(); |
| 352 it != rvh_list.end(); ++it) { | 352 it != wc_list.end(); |
| 353 WebContents* web_contents = WebContents::FromRenderViewHost(*it); | 353 ++it) { |
| 354 if (!web_contents) | 354 if (tab_web_contents.find(*it) != tab_web_contents.end()) |
| 355 continue; | 355 continue; |
| 356 if (tab_web_contents.find(web_contents) != tab_web_contents.end()) | 356 targets.push_back(new NonTabTarget(*it)); |
| 357 continue; | |
| 358 targets.push_back(new NonTabTarget(web_contents)); | |
| 359 } | 357 } |
| 360 | 358 |
| 361 callback.Run(targets); | 359 callback.Run(targets); |
| 362 } | 360 } |
| 363 | 361 |
| 364 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( | 362 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( |
| 365 net::StreamListenSocket::Delegate* delegate, | 363 net::StreamListenSocket::Delegate* delegate, |
| 366 std::string* name) OVERRIDE { | 364 std::string* name) OVERRIDE { |
| 367 *name = base::StringPrintf( | 365 *name = base::StringPrintf( |
| 368 kTetheringSocketName, getpid(), ++last_tethering_socket_); | 366 kTetheringSocketName, getpid(), ++last_tethering_socket_); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 jobject obj, | 470 jobject obj, |
| 473 jlong server, | 471 jlong server, |
| 474 jboolean enabled) { | 472 jboolean enabled) { |
| 475 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); | 473 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); |
| 476 if (enabled) { | 474 if (enabled) { |
| 477 devtools_server->Start(); | 475 devtools_server->Start(); |
| 478 } else { | 476 } else { |
| 479 devtools_server->Stop(); | 477 devtools_server->Stop(); |
| 480 } | 478 } |
| 481 } | 479 } |
| OLD | NEW |