Commit b79eac56 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

cbui autofill: break deps on DialogClientView

This change removes all dependencies on and mentions of DialogClientView
from //cbui/views/autofill.

The only wrinkle is that a couple of tests use GetViewByID() on the
DialogClientView; these have been changed to use it on the RootView
instead.

Bug: 1011446
Change-Id: I8276c676d085c611cd27ababddad9fd60d849191
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917542
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715448}
parent 1328a2dd
......@@ -7,7 +7,6 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......@@ -31,7 +30,7 @@ void CardUnmaskPromptViewTesterViews::Close() {
void CardUnmaskPromptViewTesterViews::EnterCVCAndAccept() {
view_->cvc_input_->SetText(base::ASCIIToUTF16("123"));
view_->GetDialogClientView()->AcceptWindow();
view_->AcceptDialog();
}
} // namespace autofill
......@@ -84,7 +84,6 @@
#include "ui/views/controls/button/label_button.h"
#include "ui/views/layout/animating_layout_manager.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/window/dialog_client_view.h"
using base::Bucket;
using testing::ElementsAre;
......@@ -426,8 +425,7 @@ class LocalCardMigrationBrowserTest
CHECK(local_card_migration_view);
views::test::WidgetDestroyedWaiter destroyed_waiter(
local_card_migration_view->GetWidget());
local_card_migration_view->GetDialogClientView()
->ResetViewShownTimeStampForTesting();
local_card_migration_view->ResetViewShownTimeStampForTesting();
views::BubbleFrameView* bubble_frame_view =
static_cast<views::BubbleFrameView*>(
local_card_migration_view->GetWidget()
......@@ -448,7 +446,7 @@ class LocalCardMigrationBrowserTest
if (!specified_view) {
specified_view =
local_card_migration_view->GetDialogClientView()->GetViewByID(
local_card_migration_view->GetWidget()->GetRootView()->GetViewByID(
static_cast<int>(view_id));
}
......@@ -456,16 +454,14 @@ class LocalCardMigrationBrowserTest
}
void ClickOnOkButton(views::DialogDelegateView* local_card_migration_view) {
views::View* ok_button =
local_card_migration_view->GetDialogClientView()->ok_button();
views::View* ok_button = local_card_migration_view->GetOkButton();
ClickOnDialogViewAndWait(ok_button, local_card_migration_view);
}
void ClickOnCancelButton(
views::DialogDelegateView* local_card_migration_view) {
views::View* cancel_button =
local_card_migration_view->GetDialogClientView()->cancel_button();
views::View* cancel_button = local_card_migration_view->GetCancelButton();
ClickOnDialogViewAndWait(cancel_button, local_card_migration_view);
}
......
......@@ -32,7 +32,6 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......
......@@ -49,7 +49,6 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......
......@@ -28,7 +28,6 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......
......@@ -32,7 +32,6 @@
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......@@ -65,7 +64,7 @@ SaveCardBubbleViews::SaveCardBubbleViews(views::View* anchor_view,
void SaveCardBubbleViews::Show(DisplayReason reason) {
ShowForReason(reason);
AssignIdsToDialogClientView();
AssignIdsToDialogButtons();
}
void SaveCardBubbleViews::Hide() {
......@@ -209,11 +208,11 @@ void SaveCardBubbleViews::InitFootnoteView(views::View* footnote_view) {
footnote_view_->SetID(DialogViewId::FOOTNOTE_VIEW);
}
void SaveCardBubbleViews::AssignIdsToDialogClientView() {
auto* ok_button = GetDialogClientView()->ok_button();
void SaveCardBubbleViews::AssignIdsToDialogButtons() {
auto* ok_button = GetOkButton();
if (ok_button)
ok_button->SetID(DialogViewId::OK_BUTTON);
auto* cancel_button = GetDialogClientView()->cancel_button();
auto* cancel_button = GetCancelButton();
if (cancel_button)
cancel_button->SetID(DialogViewId::CANCEL_BUTTON);
}
......
......@@ -85,8 +85,8 @@ class SaveCardBubbleViews : public SaveCardBubbleView,
SaveCardBubbleController* controller() const { return controller_; }
// Attributes IDs to the DialogClientView and its buttons.
void AssignIdsToDialogClientView();
// Attributes IDs to the dialog's DialogDelegate-supplied buttons.
void AssignIdsToDialogButtons();
// views::BubbleDialogDelegateView:
void Init() override;
......
......@@ -80,7 +80,6 @@
#include "ui/views/layout/animating_layout_manager.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
#include "ui/views/window/non_client_view.h"
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
#include "chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h"
......@@ -639,7 +638,6 @@ class SaveCardBubbleViewsFullFormBrowserTest
void ClickOnDialogView(views::View* view) {
GetSaveCardBubbleViews()
->GetDialogClientView()
->ResetViewShownTimeStampForTesting();
views::BubbleFrameView* bubble_frame_view =
static_cast<views::BubbleFrameView*>(GetSaveCardBubbleViews()
......@@ -676,10 +674,10 @@ class SaveCardBubbleViewsFullFormBrowserTest
if (!specified_view) {
// Many of the save card bubble's inner Views are not child views but
// rather contained by its DialogClientView. If we didn't find what we
// were looking for, check there as well.
// rather contained by the dialog. If we didn't find what we were looking
// for, check there as well.
specified_view =
save_card_bubble_views->GetDialogClientView()->GetViewByID(
save_card_bubble_views->GetWidget()->GetRootView()->GetViewByID(
static_cast<int>(view_id));
}
if (!specified_view) {
......
......@@ -42,7 +42,6 @@
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......
......@@ -8,7 +8,6 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/autofill/payments/verify_pending_dialog_view_impl.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......@@ -83,7 +82,7 @@ IN_PROC_BROWSER_TEST_F(VerifyPendingDialogViewBrowserTest,
IN_PROC_BROWSER_TEST_F(VerifyPendingDialogViewBrowserTest, ClickCancelButton) {
ShowUi(std::string());
VerifyUi();
GetVerifyPendingDialog()->GetDialogClientView()->CancelWindow();
GetVerifyPendingDialog()->CancelDialog();
base::RunLoop().RunUntilIdle();
}
......
......@@ -10,7 +10,6 @@
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......
......@@ -9,7 +9,6 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/autofill/payments/webauthn_offer_dialog_view_impl.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......@@ -79,7 +78,7 @@ IN_PROC_BROWSER_TEST_F(WebauthnOfferDialogBrowserTest,
IN_PROC_BROWSER_TEST_F(WebauthnOfferDialogBrowserTest, ClickCancelButton) {
ShowUi(std::string());
VerifyUi();
GetWebauthnOfferDialog()->GetDialogClientView()->CancelWindow();
GetWebauthnOfferDialog()->CancelDialog();
base::RunLoop().RunUntilIdle();
}
......
......@@ -15,7 +15,6 @@
#include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment