1 // Copyright (c) 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/test/test_confirm_bubble_model.h"
7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h"
10 TestConfirmBubbleModel::TestConfirmBubbleModel(bool* model_deleted
,
14 : model_deleted_(model_deleted
),
15 accept_clicked_(accept_clicked
),
16 cancel_clicked_(cancel_clicked
),
17 link_clicked_(link_clicked
) {
20 TestConfirmBubbleModel::~TestConfirmBubbleModel() {
22 *model_deleted_
= true;
25 base::string16
TestConfirmBubbleModel::GetTitle() const {
26 return base::ASCIIToUTF16("Test");
29 base::string16
TestConfirmBubbleModel::GetMessageText() const {
30 return base::ASCIIToUTF16("Test Message");
33 int TestConfirmBubbleModel::GetButtons() const {
34 return BUTTON_OK
| BUTTON_CANCEL
;
37 base::string16
TestConfirmBubbleModel::GetButtonLabel(
38 BubbleButton button
) const {
39 return button
== BUTTON_OK
? base::ASCIIToUTF16("OK")
40 : base::ASCIIToUTF16("Cancel");
43 void TestConfirmBubbleModel::Accept() {
45 *accept_clicked_
= true;
48 void TestConfirmBubbleModel::Cancel() {
50 *cancel_clicked_
= true;
53 base::string16
TestConfirmBubbleModel::GetLinkText() const {
54 return base::ASCIIToUTF16("Link");
57 void TestConfirmBubbleModel::LinkClicked() {
59 *link_clicked_
= true;