| Index: chrome/browser/ui/webui/inspect_ui.cc
|
| diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc
|
| index 4cbeda3061a648c43e559dc339e0ab3b01fc7770..18c88bd5d45f6a70df42ec5855b4af5a0d1fac28 100644
|
| --- a/chrome/browser/ui/webui/inspect_ui.cc
|
| +++ b/chrome/browser/ui/webui/inspect_ui.cc
|
| @@ -31,7 +31,6 @@
|
| #include "content/public/common/frame_navigate_params.h"
|
| #include "grit/browser_resources.h"
|
|
|
| -using content::DevToolsAgentHost;
|
| using content::WebContents;
|
| using content::WebUIMessageHandler;
|
|
|
| @@ -277,17 +276,17 @@
|
|
|
| void InspectUI::Inspect(const std::string& source_id,
|
| const std::string& target_id) {
|
| - scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
|
| + DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| if (target) {
|
| const std::string target_type = target->GetType();
|
| - target->Inspect();
|
| + target->Inspect(Profile::FromWebUI(web_ui()));
|
| ForceUpdateIfNeeded(source_id, target_type);
|
| }
|
| }
|
|
|
| void InspectUI::Activate(const std::string& source_id,
|
| const std::string& target_id) {
|
| - scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
|
| + DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| if (target) {
|
| const std::string target_type = target->GetType();
|
| target->Activate();
|
| @@ -297,7 +296,7 @@
|
|
|
| void InspectUI::Close(const std::string& source_id,
|
| const std::string& target_id) {
|
| - scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
|
| + DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| if (target) {
|
| const std::string target_type = target->GetType();
|
| target->Close();
|
| @@ -307,7 +306,7 @@
|
|
|
| void InspectUI::Reload(const std::string& source_id,
|
| const std::string& target_id) {
|
| - scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
|
| + DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| if (target) {
|
| const std::string target_type = target->GetType();
|
| target->Reload();
|
| @@ -499,15 +498,14 @@
|
| DevToolsTargetsUIHandler* InspectUI::FindTargetHandler(
|
| const std::string& source_id) {
|
| TargetHandlerMap::iterator it = target_handlers_.find(source_id);
|
| - return it != target_handlers_.end() ? it->second : nullptr;
|
| -}
|
| -
|
| -scoped_refptr<content::DevToolsAgentHost> InspectUI::FindTarget(
|
| + return it != target_handlers_.end() ? it->second : NULL;
|
| +}
|
| +
|
| +DevToolsTargetImpl* InspectUI::FindTarget(
|
| const std::string& source_id, const std::string& target_id) {
|
| TargetHandlerMap::iterator it = target_handlers_.find(source_id);
|
| - DevToolsTargetImpl* target = it != target_handlers_.end() ?
|
| - it->second->GetTarget(target_id) : nullptr;
|
| - return target ? target->GetAgentHost() : nullptr;
|
| + return it != target_handlers_.end() ?
|
| + it->second->GetTarget(target_id) : NULL;
|
| }
|
|
|
| void InspectUI::PopulateTargets(const std::string& source,
|
| @@ -520,7 +518,7 @@
|
| const std::string& target_type) {
|
| // TODO(dgozman): remove this after moving discovery to protocol.
|
| // See crbug.com/398049.
|
| - if (target_type != content::DevToolsAgentHost::kTypeServiceWorker)
|
| + if (target_type != DevToolsTargetImpl::kTargetTypeServiceWorker)
|
| return;
|
| DevToolsTargetsUIHandler* handler = FindTargetHandler(source_id);
|
| if (handler)
|
|
|