cbui: remove ExtensionInstallDialogView GetDialogButtonLabel
This dialog gets its strings from an ExtensionInstallPrompt::Prompt, via the Get{Accept,Abort}ButtonLabel methods. Those methods, in turn, depend on two fields of Prompt: type_ and extension_. Better yet, type_ is already const. I attempted to make extension_ const but wasn't able to do so. Instead, this change relies on the current behavior of that class, which is that it is always used like this: auto prompt = make_unique<Prompt>(); // somewhere else: prompt->set_extension(...); // yet a third place: ShowDialog(..., std::move(prompt), ...) Not all the places where Prompt is constructed have ready access to the extension it will eventually represent, which makes passing the extension as a constructor parameter to Prompt infeasible. Rats. This change calls the prompt from ExtensionInstallDialogView's constructor to get the appropriate button labels and apply them. Bug: 1011446 Change-Id: If4ceff51f3aa4a5ca3cb8c3013954748377c8544 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872420Reviewed-by:Robert Liao <robliao@chromium.org> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org> Cr-Commit-Position: refs/heads/master@{#708189}
Showing
Please register or sign in to comment