Remove FontList members of DownloadItemView.
Instead, use the affected labels themselves to do metric calculations, or, where FontLists are necessary, to obtain the FontLists. This makes a couple of behavioral changes: (1) The "opening" string no longer assumes that the string length with the filename = the string length without the filename + the filename length. This isn't a valid assumption in general (due to e.g. kerning). Instead it just subs in the normally-elided filename. This isn't ideal; really we'd like to do filename eliding on the full string at the point where the filename subs in, but no APIs exist for that today. (2) The filename is no longer abbreviated when showing the "prompt for scanning" dialog, since that's not inside the shelf and eliding is unnecessary (and maybe harmful). This will also make it possible to style the filename inside |file_name_label_| as is already done for other labels, but that change isn't in this CL. In theory, this would also behave better if the warning/deep scanning/ filename labels used different font sizes (but in practice they don't). Bug: none Change-Id: I5b6a0607a86b090204f65ff05151340b94d3a53d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315438 Commit-Queue: Peter Kasting <pkasting@chromium.org> Reviewed-by:Shakti Sahu <shaktisahu@chromium.org> Cr-Commit-Position: refs/heads/master@{#791584}
Showing
Please register or sign in to comment