This source file includes following definitions.
- bubbles_shown_
- TestGeneratedCreditCardBubbleController
- IsInstalled
- GetTestingBubble
- CreateBubble
- CanShow
- SetupAndShow
#include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_controller.h"
#include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_view.h"
#include "content/public/browser/web_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
TestGeneratedCreditCardBubbleController::
TestGeneratedCreditCardBubbleController(content::WebContents* contents)
: GeneratedCreditCardBubbleController(contents),
bubbles_shown_(0) {
contents->SetUserData(UserDataKey(), this);
}
TestGeneratedCreditCardBubbleController::
~TestGeneratedCreditCardBubbleController() {}
bool TestGeneratedCreditCardBubbleController::IsInstalled() const {
return web_contents()->GetUserData(UserDataKey()) == this;
}
TestGeneratedCreditCardBubbleView* TestGeneratedCreditCardBubbleController::
GetTestingBubble() {
return static_cast<TestGeneratedCreditCardBubbleView*>(
GeneratedCreditCardBubbleController::bubble().get());
}
base::WeakPtr<GeneratedCreditCardBubbleView>
TestGeneratedCreditCardBubbleController::CreateBubble() {
return TestGeneratedCreditCardBubbleView::Create(GetWeakPtr());
}
bool TestGeneratedCreditCardBubbleController::CanShow() const {
return true;
}
void TestGeneratedCreditCardBubbleController::SetupAndShow(
const base::string16& fronting_card_name,
const base::string16& backing_card_name) {
GeneratedCreditCardBubbleController::SetupAndShow(fronting_card_name,
backing_card_name);
++bubbles_shown_;
}
}