| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/devtools_manager_delegate_android.h" | 5 #include "chrome/browser/android/devtools_manager_delegate_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/android/tab_android.h" | 11 #include "chrome/browser/android/tab_android.h" |
| 12 #include "chrome/browser/devtools/devtools_network_protocol_handler.h" | 12 #include "chrome/browser/devtools/devtools_network_protocol_handler.h" |
| 13 #include "chrome/browser/ui/android/tab_model/tab_model.h" | 13 #include "chrome/browser/ui/android/tab_model/tab_model.h" |
| 14 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | 14 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" |
| 15 #include "chrome/common/features.h" | 15 #include "chrome/common/features.h" |
| 16 #include "chrome/grit/browser_resources.h" |
| 16 #include "content/public/browser/devtools_agent_host.h" | 17 #include "content/public/browser/devtools_agent_host.h" |
| 17 #include "content/public/browser/devtools_agent_host_client.h" | 18 #include "content/public/browser/devtools_agent_host_client.h" |
| 18 #include "content/public/browser/devtools_external_agent_proxy.h" | 19 #include "content/public/browser/devtools_external_agent_proxy.h" |
| 19 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" | 20 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" |
| 20 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 22 #include "ui/base/resource/resource_bundle.h" |
| 21 | 23 |
| 22 using content::DevToolsAgentHost; | 24 using content::DevToolsAgentHost; |
| 23 using content::WebContents; | 25 using content::WebContents; |
| 24 | 26 |
| 25 namespace { | 27 namespace { |
| 26 | 28 |
| 27 class TabProxyDelegate : public content::DevToolsExternalAgentProxyDelegate, | 29 class TabProxyDelegate : public content::DevToolsExternalAgentProxyDelegate, |
| 28 public content::DevToolsAgentHostClient { | 30 public content::DevToolsAgentHostClient { |
| 29 public: | 31 public: |
| 30 explicit TabProxyDelegate(TabAndroid* tab) | 32 explicit TabProxyDelegate(TabAndroid* tab) |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (!web_contents) | 245 if (!web_contents) |
| 244 return nullptr; | 246 return nullptr; |
| 245 | 247 |
| 246 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); | 248 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); |
| 247 if (!tab) | 249 if (!tab) |
| 248 return nullptr; | 250 return nullptr; |
| 249 | 251 |
| 250 return DevToolsAgentHost::Create(new TabProxyDelegate(tab)); | 252 return DevToolsAgentHost::Create(new TabProxyDelegate(tab)); |
| 251 } | 253 } |
| 252 | 254 |
| 255 std::string DevToolsManagerDelegateAndroid::GetDiscoveryPageHTML() { |
| 256 return ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 257 IDR_DEVTOOLS_DISCOVERY_PAGE_HTML).as_string(); |
| 258 } |
| 259 |
| 260 std::string DevToolsManagerDelegateAndroid::GetFrontendResource( |
| 261 const std::string& path) { |
| 262 return std::string(); |
| 263 } |
| 264 |
| 253 void DevToolsManagerDelegateAndroid::DevToolsAgentStateChanged( | 265 void DevToolsManagerDelegateAndroid::DevToolsAgentStateChanged( |
| 254 DevToolsAgentHost* agent_host, bool attached) { | 266 DevToolsAgentHost* agent_host, bool attached) { |
| 255 network_protocol_handler_->DevToolsAgentStateChanged(agent_host, attached); | 267 network_protocol_handler_->DevToolsAgentStateChanged(agent_host, attached); |
| 256 } | 268 } |
| OLD | NEW |