1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_controller.h"
7 #include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_view.h"
8 #include "content/public/browser/web_contents.h"
9 #include "testing/gtest/include/gtest/gtest.h"
13 TestGeneratedCreditCardBubbleController::
14 TestGeneratedCreditCardBubbleController(content::WebContents
* contents
)
15 : GeneratedCreditCardBubbleController(contents
),
17 contents
->SetUserData(UserDataKey(), this);
20 TestGeneratedCreditCardBubbleController::
21 ~TestGeneratedCreditCardBubbleController() {}
23 bool TestGeneratedCreditCardBubbleController::IsInstalled() const {
24 return web_contents()->GetUserData(UserDataKey()) == this;
27 TestGeneratedCreditCardBubbleView
* TestGeneratedCreditCardBubbleController::
29 return static_cast<TestGeneratedCreditCardBubbleView
*>(
30 GeneratedCreditCardBubbleController::bubble().get());
33 base::WeakPtr
<GeneratedCreditCardBubbleView
>
34 TestGeneratedCreditCardBubbleController::CreateBubble() {
35 return TestGeneratedCreditCardBubbleView::Create(GetWeakPtr());
38 bool TestGeneratedCreditCardBubbleController::CanShow() const {
42 void TestGeneratedCreditCardBubbleController::SetupAndShow(
43 const base::string16
& fronting_card_name
,
44 const base::string16
& backing_card_name
) {
45 GeneratedCreditCardBubbleController::SetupAndShow(fronting_card_name
,
50 } // namespace autofill