| 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 a887f73f2714657e937f17ba44756b2ab02a1d3e..4feb3b3faeb0a8f0a265d0cc3c691db818b31645 100644
|
| --- a/chrome/browser/ui/webui/inspect_ui.cc
|
| +++ b/chrome/browser/ui/webui/inspect_ui.cc
|
| @@ -275,29 +275,41 @@ void InspectUI::InitUI() {
|
| void InspectUI::Inspect(const std::string& source_id,
|
| const std::string& target_id) {
|
| DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| - if (target)
|
| + if (target) {
|
| + const std::string target_type = target->GetType();
|
| target->Inspect(Profile::FromWebUI(web_ui()));
|
| + ForceUpdateIfNeeded(source_id, target_type);
|
| + }
|
| }
|
|
|
| void InspectUI::Activate(const std::string& source_id,
|
| const std::string& target_id) {
|
| DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| - if (target)
|
| + if (target) {
|
| + const std::string target_type = target->GetType();
|
| target->Activate();
|
| + ForceUpdateIfNeeded(source_id, target_type);
|
| + }
|
| }
|
|
|
| void InspectUI::Close(const std::string& source_id,
|
| const std::string& target_id) {
|
| DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| - if (target)
|
| + if (target) {
|
| + const std::string target_type = target->GetType();
|
| target->Close();
|
| + ForceUpdateIfNeeded(source_id, target_type);
|
| + }
|
| }
|
|
|
| void InspectUI::Reload(const std::string& source_id,
|
| const std::string& target_id) {
|
| DevToolsTargetImpl* target = FindTarget(source_id, target_id);
|
| - if (target)
|
| + if (target) {
|
| + const std::string target_type = target->GetType();
|
| target->Reload();
|
| + ForceUpdateIfNeeded(source_id, target_type);
|
| + }
|
| }
|
|
|
| static void NoOp(DevToolsTargetImpl*) {}
|
| @@ -528,6 +540,17 @@ void InspectUI::PopulateTargets(const std::string& source,
|
| targets);
|
| }
|
|
|
| +void InspectUI::ForceUpdateIfNeeded(const std::string& source_id,
|
| + const std::string& target_type) {
|
| + // TODO(dgozman): remove this after moving discovery to protocol.
|
| + // See crbug.com/398049.
|
| + if (target_type != DevToolsTargetImpl::kTargetTypeServiceWorker)
|
| + return;
|
| + DevToolsTargetsUIHandler* handler = FindTargetHandler(source_id);
|
| + if (handler)
|
| + handler->ForceUpdate();
|
| +}
|
| +
|
| void InspectUI::PopulatePortStatus(const base::Value& status) {
|
| web_ui()->CallJavascriptFunction("populatePortStatus", status);
|
| }
|
|
|