Commit 52f028e6 authored by Eric Lawrence's avatar Eric Lawrence Committed by Commit Bot

Simplify title of DevTools window

By shortening "Developer Tools" to "DevTools", we make it easier for a
user to distinguish multiple instances in the Windows task bar, and
better align to DevTools branding.

Bug: 729910
Change-Id: I961cdd9890ca3569d67cf6ed98697f5dbed79086
Reviewed-on: https://chromium-review.googlesource.com/949781Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Eric Lawrence <elawrence@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547813}
parent 9d8ac1b4
...@@ -91,7 +91,7 @@ namespace { ...@@ -91,7 +91,7 @@ namespace {
static const char kFrontendHostId[] = "id"; static const char kFrontendHostId[] = "id";
static const char kFrontendHostMethod[] = "method"; static const char kFrontendHostMethod[] = "method";
static const char kFrontendHostParams[] = "params"; static const char kFrontendHostParams[] = "params";
static const char kTitleFormat[] = "Developer Tools - %s"; static const char kTitleFormat[] = "DevTools - %s";
static const char kDevToolsActionTakenHistogram[] = "DevTools.ActionTaken"; static const char kDevToolsActionTakenHistogram[] = "DevTools.ActionTaken";
static const char kDevToolsPanelShownHistogram[] = "DevTools.PanelShown"; static const char kDevToolsPanelShownHistogram[] = "DevTools.PanelShown";
...@@ -573,8 +573,8 @@ DevToolsUIBindings* DevToolsUIBindings::ForWebContents( ...@@ -573,8 +573,8 @@ DevToolsUIBindings* DevToolsUIBindings::ForWebContents(
it != instances->end(); ++it) { it != instances->end(); ++it) {
if ((*it)->web_contents() == web_contents) if ((*it)->web_contents() == web_contents)
return *it; return *it;
} }
return NULL; return NULL;
} }
DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents) DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents)
...@@ -728,9 +728,19 @@ void DevToolsUIBindings::InspectElementCompleted() { ...@@ -728,9 +728,19 @@ void DevToolsUIBindings::InspectElementCompleted() {
void DevToolsUIBindings::InspectedURLChanged(const std::string& url) { void DevToolsUIBindings::InspectedURLChanged(const std::string& url) {
content::NavigationController& controller = web_contents()->GetController(); content::NavigationController& controller = web_contents()->GetController();
content::NavigationEntry* entry = controller.GetActiveEntry(); content::NavigationEntry* entry = controller.GetActiveEntry();
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. // DevTools UI is not localized.
web_contents()->UpdateTitleForEntry( web_contents()->UpdateTitleForEntry(
entry, base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str()))); entry, base::UTF8ToUTF16(
base::StringPrintf(kTitleFormat, simplified_url.c_str())));
} }
void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback, void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback,
......
...@@ -151,7 +151,7 @@ Host.InspectorFrontendHostStub = class { ...@@ -151,7 +151,7 @@ Host.InspectorFrontendHostStub = class {
* @suppressGlobalPropertiesCheck * @suppressGlobalPropertiesCheck
*/ */
inspectedURLChanged(url) { inspectedURLChanged(url) {
document.title = Common.UIString('Developer Tools - %s', url); document.title = Common.UIString('DevTools - %s', url.replace(/^https?:\/\//, ''));
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment