Skip to content

Commit

Permalink
Remove unused RenderViewHost parameter in OnDialogShown.
Browse files Browse the repository at this point in the history
Bug: 763548, 1002276
Change-Id: I31ce542d39baee996359ba179759ac00239744c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904448
Commit-Queue: Scott Violet <sky@chromium.org>
Auto-Submit: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713681}
  • Loading branch information
naskooskov authored and Commit Bot committed Nov 8, 2019
1 parent 3a7be23 commit 38512b7
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 46 deletions.
3 changes: 1 addition & 2 deletions chrome/browser/chromeos/login/ui/login_web_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ WebContents* LoginWebDialog::GetCurrentWebContents() {
return stack.empty() ? nullptr : stack.front();
}

void LoginWebDialog::OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) {
void LoginWebDialog::OnDialogShown(content::WebUI* webui) {
g_web_contents_stack.Pointer()->push_front(webui->GetWebContents());
}

Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/chromeos/login/ui/login_web_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ class LoginWebDialog : public ui::WebDialogDelegate {
void GetDialogSize(gfx::Size* size) const override;
void GetMinimumDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) override;
void OnDialogShown(content::WebUI* webui) override;
// NOTE: This function deletes this object at the end.
void OnDialogClosed(const std::string& json_retval) override;
void OnCloseContents(content::WebContents* source,
Expand Down
4 changes: 1 addition & 3 deletions chrome/browser/ui/webui/certificate_viewer_webui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ std::string CertificateViewerDialog::GetDialogArgs() const {
return data;
}

void CertificateViewerDialog::OnDialogShown(
content::WebUI* webui,
content::RenderViewHost* render_view_host) {
void CertificateViewerDialog::OnDialogShown(content::WebUI* webui) {
webui_ = webui;
}

Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/ui/webui/certificate_viewer_webui.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class CertificateViewerDialog : public ui::WebDialogDelegate {
std::vector<content::WebUIMessageHandler*>* handlers) const override;
void GetDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) override;
void OnDialogShown(content::WebUI* webui) override;
void OnDialogClosed(const std::string& json_retval) override;
void OnCloseContents(content::WebContents* source,
bool* out_close_dialog) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ std::string AssistantOptInDialog::GetDialogArgs() const {
return std::string();
}

void AssistantOptInDialog::OnDialogShown(
content::WebUI* webui,
content::RenderViewHost* render_view_host) {
void AssistantOptInDialog::OnDialogShown(content::WebUI* webui) {
assistant_ui_ = static_cast<AssistantOptInUI*>(webui->GetController());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ class AssistantOptInDialog : public SystemWebDialogDelegate {
// ui::WebDialogDelegate
void GetDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) override;
void OnDialogShown(content::WebUI* webui) override;
void OnDialogClosed(const std::string& json_retval) override;

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ bool CrostiniInstallerDialog::CanCloseDialog() const {
return installer_ui_ == nullptr || installer_ui_->can_close();
}

void CrostiniInstallerDialog::OnDialogShown(
content::WebUI* webui,
content::RenderViewHost* render_view_host) {
void CrostiniInstallerDialog::OnDialogShown(content::WebUI* webui) {
installer_ui_ = static_cast<CrostiniInstallerUI*>(webui->GetController());
return SystemWebDialogDelegate::OnDialogShown(webui, render_view_host);
return SystemWebDialogDelegate::OnDialogShown(webui);
}

void CrostiniInstallerDialog::OnCloseContents(content::WebContents* source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class CrostiniInstallerDialog : public SystemWebDialogDelegate {
bool ShouldShowCloseButton() const override;
void AdjustWidgetInitParams(views::Widget::InitParams* params) override;
bool CanCloseDialog() const override;
void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) override;
void OnDialogShown(content::WebUI* webui) override;
void OnCloseContents(content::WebContents* source,
bool* out_close_dialog) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ std::string SystemWebDialogDelegate::GetDialogArgs() const {
return std::string();
}

void SystemWebDialogDelegate::OnDialogShown(
content::WebUI* webui,
content::RenderViewHost* render_view_host) {
void SystemWebDialogDelegate::OnDialogShown(content::WebUI* webui) {
webui_ = webui;

if (features::IsSplitSettingsEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ class SystemWebDialogDelegate : public ui::WebDialogDelegate {
void GetDialogSize(gfx::Size* size) const override;
bool CanResizeDialog() const override;
std::string GetDialogArgs() const override;
void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) override;
void OnDialogShown(content::WebUI* webui) override;
// Note: deletes |this|.
void OnDialogClosed(const std::string& json_retval) override;
void OnCloseContents(content::WebContents* source,
Expand Down
5 changes: 1 addition & 4 deletions chrome/browser/ui/webui/constrained_web_dialog_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "base/values.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h"
Expand All @@ -28,7 +27,6 @@
#endif

using content::RenderFrameHost;
using content::RenderViewHost;
using content::WebContents;
using content::WebUIMessageHandler;

Expand Down Expand Up @@ -85,8 +83,7 @@ void ConstrainedWebDialogUI::RenderFrameCreated(
web_ui()->AddMessageHandler(base::WrapUnique(handler));
}

dialog_delegate->OnDialogShown(web_ui(),
render_frame_host->GetRenderViewHost());
dialog_delegate->OnDialogShown(web_ui());
}

void ConstrainedWebDialogUI::OnDialogCloseMessage(const base::ListValue* args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ bool InlineLoginHandlerDialogChromeOS::ShouldShowDialogTitle() const {
return false;
}

void InlineLoginHandlerDialogChromeOS::OnDialogShown(
content::WebUI* webui,
content::RenderViewHost* render_view_host) {
SystemWebDialogDelegate::OnDialogShown(webui, render_view_host);
void InlineLoginHandlerDialogChromeOS::OnDialogShown(content::WebUI* webui) {
SystemWebDialogDelegate::OnDialogShown(webui);
web_modal::WebContentsModalDialogManager::CreateForWebContents(
webui->GetWebContents());
web_modal::WebContentsModalDialogManager::FromWebContents(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class InlineLoginHandlerDialogChromeOS
void GetDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
bool ShouldShowDialogTitle() const override;
void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) override;
void OnDialogShown(content::WebUI* webui) override;

private:
InlineLoginHandlerModalDelegate delegate_;
Expand Down
5 changes: 2 additions & 3 deletions ui/views/controls/webview/web_dialog_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,9 @@ std::string WebDialogView::GetDialogArgs() const {
return std::string();
}

void WebDialogView::OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) {
void WebDialogView::OnDialogShown(content::WebUI* webui) {
if (delegate_)
delegate_->OnDialogShown(webui, render_view_host);
delegate_->OnDialogShown(webui);
}

void WebDialogView::OnDialogClosed(const std::string& json_retval) {
Expand Down
3 changes: 1 addition & 2 deletions ui/views/controls/webview/web_dialog_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ class WEBVIEW_EXPORT WebDialogView : public views::ClientView,
void GetDialogSize(gfx::Size* size) const override;
void GetMinimumDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) override;
void OnDialogShown(content::WebUI* webui) override;
void OnDialogClosed(const std::string& json_retval) override;
void OnDialogCloseFromWebUI(const std::string& json_retval) override;
void OnCloseContents(content::WebContents* source,
Expand Down
5 changes: 1 addition & 4 deletions ui/web_dialogs/web_dialog_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class GURL;

namespace content {
class RenderFrameHost;
class RenderViewHost;
class WebContents;
class WebUI;
class WebUIMessageHandler;
Expand Down Expand Up @@ -88,9 +87,7 @@ class WEB_DIALOGS_EXPORT WebDialogDelegate {

// A callback to notify the delegate that a web dialog has been shown.
// |webui| is the WebUI with which the dialog is associated.
// |render_view_host| is the RenderViewHost for the shown dialog.
virtual void OnDialogShown(content::WebUI* webui,
content::RenderViewHost* render_view_host) {}
virtual void OnDialogShown(content::WebUI* webui) {}

// A callback to notify the delegate that the window is requesting to be
// closed. If this returns true, the dialog is closed, otherwise the
Expand Down
3 changes: 1 addition & 2 deletions ui/web_dialogs/web_dialog_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h"
Expand Down Expand Up @@ -95,7 +94,7 @@ void WebDialogUIBase::HandleRenderFrameCreated(
web_ui_->AddMessageHandler(base::WrapUnique(handler));

if (delegate)
delegate->OnDialogShown(web_ui_, render_frame_host->GetRenderViewHost());
delegate->OnDialogShown(web_ui_);
}

void WebDialogUIBase::OnDialogClosed(const base::ListValue* args) {
Expand Down

0 comments on commit 38512b7

Please sign in to comment.