diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-06-10 13:57:42 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-09-09 15:19:10 +0200 |
commit | 455619d3875e0e0e7a03734806d61c7998735cd4 (patch) | |
tree | 3e2558da4525819ad9bd5e46ee9f471c73aa8d5f /src/core/devtools_frontend_qt.cpp | |
parent | cd61343ceb4a3de8ce16082917a2f197b2481d08 (diff) |
Adaptations for Chromium 83
Change-Id: I63ed851426b18623d549ceaf87f1b6eeec527966
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/devtools_frontend_qt.cpp')
-rw-r--r-- | src/core/devtools_frontend_qt.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp index fb79a09e6..810c91b94 100644 --- a/src/core/devtools_frontend_qt.cpp +++ b/src/core/devtools_frontend_qt.cpp @@ -487,6 +487,22 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me } else if (method == "reattach") { m_agentHost->DetachClient(this); m_agentHost->AttachClient(this); + } else if (method == "inspectedURLChanged" && params && params->GetSize() >= 1) { + std::string url; + if (!params->GetString(0, &url)) + return; + const std::string kHttpPrefix = "http://"; + const std::string kHttpsPrefix = "https://"; + const std::string simplified_url = + base::StartsWith(url, kHttpsPrefix, base::CompareCase::SENSITIVE) + ? url.substr(kHttpsPrefix.length()) + : base::StartsWith(url, kHttpPrefix, base::CompareCase::SENSITIVE) + ? url.substr(kHttpPrefix.length()) + : url; + // DevTools UI is not localized. + web_contents()->UpdateTitleForEntry(web_contents()->GetController().GetActiveEntry(), + base::UTF8ToUTF16( + base::StringPrintf("DevTools - %s", simplified_url.c_str()))); } else if (method == "openInNewTab") { std::string urlString; if (!params->GetString(0, &urlString)) |