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

Issue 6591127: fix display of filenames in file:/// URLs (Closed)

Created:
9 years, 9 months ago by Evan Martin
Modified:
9 years, 7 months ago
Reviewers:
tony, brettw, Glen Murphy
CC:
chromium-reviews, jam
Visibility:
Public.

Description

fix display of filenames in file:/// URLs (retry of previous code with tests fixed) The code attempted to shorten file:/// URLs to just the filename when displayed as the title of a page. But that appears to have regressed sometime in the past. This shortening is consistent with how we display the title of images (which are like "foo.png (123x456)".) Chrome does a poor job of displaying longer titles (most of the tab title ends up being "file:///C:/" anyway). In any case, using a FilePath to get the filename from a URL may not have even worked on Windows, where the path separator is a backslash. It appears Glen wrote the original code, Brett may be the one to have regressed it in a refactor, and I probably broke it worse in a FilePath refactor. BUG=69467 TEST=load a text file via a file: URL; tab title is just the file name Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=77008

Patch Set 1 #

Patch Set 2 : fixed #

Patch Set 3 : test #

Patch Set 4 : whitespace #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -11 lines) Patch
M content/browser/tab_contents/navigation_controller.cc View 1 1 chunk +0 lines, -11 lines 0 comments Download
M content/browser/tab_contents/navigation_entry.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/tab_contents/navigation_entry_unittest.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
evanm
9 years, 9 months ago (2011-03-02 23:21:40 UTC) #1
Glen Murphy
Will this escape spaces in filenames (%20s)? If so, it LGTM.
9 years, 9 months ago (2011-03-03 18:02:14 UTC) #2
brettw
Seems like it should be easy to write a unit test for this? Also, what ...
9 years, 9 months ago (2011-03-03 18:08:36 UTC) #3
Evan Martin
On 2011/03/03 18:02:14, Glen Murphy wrote: > Will this escape spaces in filenames (%20s)? If ...
9 years, 9 months ago (2011-03-03 18:24:20 UTC) #4
Evan Martin
On 2011/03/03 18:08:36, brettw wrote: > Seems like it should be easy to write a ...
9 years, 9 months ago (2011-03-03 18:25:20 UTC) #5
Evan Martin
Oh, sweet, we have a plain unit test for this code! I was fearing I'd ...
9 years, 9 months ago (2011-03-03 18:33:25 UTC) #6
brettw
LGTM
9 years, 9 months ago (2011-03-03 18:45:20 UTC) #7
Evan Martin
9 years, 9 months ago (2011-03-05 00:32:47 UTC) #8

          

Powered by Google App Engine
This is Rietveld 408576698