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

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

Issue 2419943002: [DevTools] Migrate from AgentStateCallbacks to DevToolsAgentHostObserver. (Closed)
Patch Set: mac Created 4 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
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/chrome_devtools_manager_delegate.h" 5 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/devtools/device/android_device_manager.h" 10 #include "chrome/browser/devtools/device/android_device_manager.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 std::string ChromeDevToolsManagerDelegate::GetDiscoveryPageHTML() { 177 std::string ChromeDevToolsManagerDelegate::GetDiscoveryPageHTML() {
178 return ResourceBundle::GetSharedInstance().GetRawDataResource( 178 return ResourceBundle::GetSharedInstance().GetRawDataResource(
179 IDR_DEVTOOLS_DISCOVERY_PAGE_HTML).as_string(); 179 IDR_DEVTOOLS_DISCOVERY_PAGE_HTML).as_string();
180 } 180 }
181 181
182 std::string ChromeDevToolsManagerDelegate::GetFrontendResource( 182 std::string ChromeDevToolsManagerDelegate::GetFrontendResource(
183 const std::string& path) { 183 const std::string& path) {
184 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string(); 184 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
185 } 185 }
186 186
187 void ChromeDevToolsManagerDelegate::DevToolsAgentStateChanged( 187 void ChromeDevToolsManagerDelegate::DevToolsAgentHostAttached(
188 DevToolsAgentHost* agent_host, 188 content::DevToolsAgentHost* agent_host) {
189 bool attached) { 189 network_protocol_handler_->DevToolsAgentStateChanged(agent_host, true);
190 network_protocol_handler_->DevToolsAgentStateChanged(agent_host, attached); 190 }
191
192 void ChromeDevToolsManagerDelegate::DevToolsAgentHostDetached(
193 content::DevToolsAgentHost* agent_host) {
194 network_protocol_handler_->DevToolsAgentStateChanged(agent_host, false);
191 } 195 }
192 196
193 std::unique_ptr<base::DictionaryValue> 197 std::unique_ptr<base::DictionaryValue>
194 ChromeDevToolsManagerDelegate::SetRemoteLocations( 198 ChromeDevToolsManagerDelegate::SetRemoteLocations(
195 content::DevToolsAgentHost* agent_host, 199 content::DevToolsAgentHost* agent_host,
196 int command_id, 200 int command_id,
197 base::DictionaryValue* params) { 201 base::DictionaryValue* params) {
198 tcp_locations_.clear(); 202 tcp_locations_.clear();
199 203
200 base::ListValue* locations; 204 base::ListValue* locations;
(...skipping 16 matching lines...) Expand all
217 if (!dictionary->GetIntegerWithoutPathExpansion(kPortParam, &port)) { 221 if (!dictionary->GetIntegerWithoutPathExpansion(kPortParam, &port)) {
218 return DevToolsProtocol::CreateInvalidParamsResponse(command_id, 222 return DevToolsProtocol::CreateInvalidParamsResponse(command_id,
219 kLocationsParam); 223 kLocationsParam);
220 } 224 }
221 tcp_locations_.insert(net::HostPortPair(host, port)); 225 tcp_locations_.insert(net::HostPortPair(host, port));
222 } 226 }
223 std::unique_ptr<base::DictionaryValue> result( 227 std::unique_ptr<base::DictionaryValue> result(
224 base::MakeUnique<base::DictionaryValue>()); 228 base::MakeUnique<base::DictionaryValue>());
225 return DevToolsProtocol::CreateSuccessResponse(command_id, std::move(result)); 229 return DevToolsProtocol::CreateSuccessResponse(command_id, std::move(result));
226 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698