Chromium Code Reviews
DescriptionAdd flag to show toolkit-views dialogs on Mac, start with HTTP-Auth.
We want to perform a side-by-side comparison of views and Cocoa using a
representative set of browser dialogs on Mac.
Adds --enable-mac-views-dialogs and a corresponding chrome://flag for this.
Initially, the conversion necessary to optionally provide views-based HTTP-
Auth dialogs on Mac is performed.
Dialogs are typically provided for a platform by providing a cross-platform
function prototype, which is defined either in c/b/ui/views or c/b/ui/cocoa.
To allow a principally Cocoa build to call both, the views definition needs to
be "aliased" to avoid a symbol conflict.
The approach is thus:
- Provide Views-only function prototype aliases in c/b/ui/browser_dialogs.h
- Cocoa includes this to optionally provide a views dialog instead at runtime
- A "fallback" file (c/b/ui/views/browser_dialogs_views.cc) for non-Mac-Cocoa
builds provides the original/unaliased definitions, which always call the
alias.
This approach minimizes disruption to callsites, and keeps most of the create-
dialog logic where it already is. (For example, login_prompt_views.cc, which
doesn't have a corresponding header so moving the logic would be problematic).
It also keeps the "fallback" file simple and mechanical in nature.
For the first dialog, there's a 60kB impact to sizes on Mac. This is partly
due to there being (temporarily) two versions of this dialog, but also because
the first dialog will explore some new codepaths previously culled at link
time (mostly related to views textfields).
BUG=511051
TEST=On Mac, enable the flag and go to an HTTP-Auth site (e.g. apted.net/chat).
The dialog should be views-based: currently it's longer/narrower, but some
simple tweaks (see http://crbug.com/506150#c5) will make them almost
indistinguishable.
Committed: https://crrev.com/081286e5f336151e19ff5ad8514e0ae3621d74ed
Cr-Commit-Position: refs/heads/master@{#342586}
Patch Set 1 #Patch Set 2 : doh; #Patch Set 3 : histograms #Patch Set 4 : Meatier comments #
Total comments: 6
Patch Set 5 : toolkit-views-dialogs-mac -> mac-views-dialogs, #if #Patch Set 6 : rebase ug - fix histograms: knew I forgot to rename something (darn flaky tryjobs..) #
Total comments: 1
Messages
Total messages: 19 (7 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||