Commit 101683ca authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Implement a skeleton of a bubble notifyig about remaining compromised passwords.

Mocks: https://docs.google.com/presentation/d/1yWuZO-fjXhdRp64nWRbnHEyzpFd1KOMS3u1_1XMdGuA/edit#slide=id.g7c9229dfe2_22_49

Bug: 1049200
Change-Id: I8ba3e7687379e9bc36f12c64f0b61845bbd7f2cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157228Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760590}
parent 5d3ed01a
......@@ -3244,6 +3244,8 @@ jumbo_static_library("ui") {
"views/passwords/password_save_update_view.h",
"views/passwords/password_save_update_with_account_store_view.cc",
"views/passwords/password_save_update_with_account_store_view.h",
"views/passwords/post_save_compromised_bubble_view.cc",
"views/passwords/post_save_compromised_bubble_view.h",
"views/payments/contact_info_editor_view_controller.cc",
"views/payments/contact_info_editor_view_controller.h",
"views/payments/credit_card_editor_view_controller.cc",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/passwords/post_save_compromised_bubble_view.h"
#include "chrome/browser/ui/passwords/passwords_model_delegate.h"
PostSaveCompromisedBubbleView::PostSaveCompromisedBubbleView(
content::WebContents* web_contents,
views::View* anchor_view)
: PasswordBubbleViewBase(web_contents,
anchor_view,
/*auto_dismissable=*/false),
controller_(PasswordsModelDelegateFromWebContents(web_contents)) {}
PostSaveCompromisedBubbleView::~PostSaveCompromisedBubbleView() = default;
PostSaveCompromisedBubbleController*
PostSaveCompromisedBubbleView::GetController() {
return &controller_;
}
const PostSaveCompromisedBubbleController*
PostSaveCompromisedBubbleView::GetController() const {
return &controller_;
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_POST_SAVE_COMPROMISED_BUBBLE_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_PASSWORDS_POST_SAVE_COMPROMISED_BUBBLE_VIEW_H_
#include "chrome/browser/ui/passwords/bubble_controllers/post_save_compromised_bubble_controller.h"
#include "chrome/browser/ui/views/passwords/password_bubble_view_base.h"
// Bubble notifying the user about remaining compromised credentials in the
// store.
class PostSaveCompromisedBubbleView : public PasswordBubbleViewBase {
public:
explicit PostSaveCompromisedBubbleView(content::WebContents* web_contents,
views::View* anchor_view);
~PostSaveCompromisedBubbleView() override;
private:
// PasswordBubbleViewBase
PostSaveCompromisedBubbleController* GetController() override;
const PostSaveCompromisedBubbleController* GetController() const override;
PostSaveCompromisedBubbleController controller_;
};
#endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_POST_SAVE_COMPROMISED_BUBBLE_VIEW_H_
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/passwords/post_save_compromised_bubble_view.h"
#include "chrome/browser/ui/views/passwords/password_bubble_view_test_base.h"
class PostSaveCompromisedBubbleViewTest : public PasswordBubbleViewTestBase {
public:
PostSaveCompromisedBubbleViewTest() = default;
~PostSaveCompromisedBubbleViewTest() override = default;
void CreateViewAndShow();
void TearDown() override;
protected:
PostSaveCompromisedBubbleView* view_;
};
void PostSaveCompromisedBubbleViewTest::CreateViewAndShow() {
CreateAnchorViewAndShow();
view_ = new PostSaveCompromisedBubbleView(web_contents(), anchor_view());
views::BubbleDialogDelegateView::CreateBubble(view_)->Show();
}
void PostSaveCompromisedBubbleViewTest::TearDown() {
view_->GetWidget()->CloseWithReason(
views::Widget::ClosedReason::kCloseButtonClicked);
PasswordBubbleViewTestBase::TearDown();
}
TEST_F(PostSaveCompromisedBubbleViewTest, HasTwoButtons) {
CreateViewAndShow();
EXPECT_TRUE(view_->GetOkButton());
EXPECT_TRUE(view_->GetCancelButton());
}
......@@ -4284,6 +4284,7 @@ test("unit_tests") {
"../browser/ui/views/passwords/password_bubble_view_test_base.h",
"../browser/ui/views/passwords/password_save_unsynced_credentials_locally_view_unittest.cc",
"../browser/ui/views/passwords/password_save_update_with_account_store_view_unittest.cc",
"../browser/ui/views/passwords/post_save_compromised_bubble_view_unittest.cc",
"../common/media_router/discovery/media_sink_internal_unittest.cc",
"../common/media_router/discovery/media_sink_service_base_unittest.cc",
"../common/media_router/mojom/media_router_mojom_traits_unittest.cc",
......
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