| 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/ui/webui/devtools_ui.h" | 5 #include "chrome/browser/ui/webui/devtools_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 314 } |
| 315 | 315 |
| 316 bool OpenRemotePageRequest::OpenInBrowser( | 316 bool OpenRemotePageRequest::OpenInBrowser( |
| 317 DevToolsAndroidBridge::RemoteBrowser* browser) { | 317 DevToolsAndroidBridge::RemoteBrowser* browser) { |
| 318 if (!browser->IsChrome()) | 318 if (!browser->IsChrome()) |
| 319 return false; | 319 return false; |
| 320 #if defined(DEBUG_DEVTOOLS) | 320 #if defined(DEBUG_DEVTOOLS) |
| 321 if (browser->serial() == kLocalSerial) | 321 if (browser->serial() == kLocalSerial) |
| 322 return false; | 322 return false; |
| 323 #endif // defined(DEBUG_DEVTOOLS) | 323 #endif // defined(DEBUG_DEVTOOLS) |
| 324 browser->Open(url_, base::Bind(&OpenRemotePageRequest::RemotePageOpened, | 324 android_bridge_->Open(browser, url_, |
| 325 base::Unretained(this))); | 325 base::Bind(&OpenRemotePageRequest::RemotePageOpened, |
| 326 base::Unretained(this))); |
| 326 return true; | 327 return true; |
| 327 } | 328 } |
| 328 | 329 |
| 329 void OpenRemotePageRequest::RemotePageOpened( | 330 void OpenRemotePageRequest::RemotePageOpened( |
| 330 DevToolsAndroidBridge::RemotePage* page) { | 331 DevToolsAndroidBridge::RemotePage* page) { |
| 331 callback_.Run(page); | 332 callback_.Run(page); |
| 332 android_bridge_->RemoveDeviceListListener(this); | 333 android_bridge_->RemoveDeviceListListener(this); |
| 333 delete this; | 334 delete this; |
| 334 } | 335 } |
| 335 | 336 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 content::NavigationController& navigation_controller = | 407 content::NavigationController& navigation_controller = |
| 407 web_ui()->GetWebContents()->GetController(); | 408 web_ui()->GetWebContents()->GetController(); |
| 408 content::NavigationController::LoadURLParams params(url); | 409 content::NavigationController::LoadURLParams params(url); |
| 409 params.should_replace_current_entry = true; | 410 params.should_replace_current_entry = true; |
| 410 remote_frontend_loading_url_ = virtual_url; | 411 remote_frontend_loading_url_ = virtual_url; |
| 411 navigation_controller.LoadURLWithParams(params); | 412 navigation_controller.LoadURLWithParams(params); |
| 412 navigation_controller.GetPendingEntry()->SetVirtualURL(virtual_url); | 413 navigation_controller.GetPendingEntry()->SetVirtualURL(virtual_url); |
| 413 | 414 |
| 414 bindings_.AttachTo(page->GetTarget()->GetAgentHost()); | 415 bindings_.AttachTo(page->GetTarget()->GetAgentHost()); |
| 415 } | 416 } |
| OLD | NEW |