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"
9 #include "grit/theme_resources.h"
10 #include "ui/base/resource/resource_bundle.h"
12 TestConfirmBubbleModel::TestConfirmBubbleModel(bool* model_deleted
,
16 : model_deleted_(model_deleted
),
17 accept_clicked_(accept_clicked
),
18 cancel_clicked_(cancel_clicked
),
19 link_clicked_(link_clicked
) {
22 TestConfirmBubbleModel::~TestConfirmBubbleModel() {
24 *model_deleted_
= true;
27 base::string16
TestConfirmBubbleModel::GetTitle() const {
28 return base::ASCIIToUTF16("Test");
31 base::string16
TestConfirmBubbleModel::GetMessageText() const {
32 return base::ASCIIToUTF16("Test Message");
35 gfx::Image
* TestConfirmBubbleModel::GetIcon() const {
36 // Return an arbitrary non-empty image.
37 return &ui::ResourceBundle::GetSharedInstance().GetImageNamed(
41 int TestConfirmBubbleModel::GetButtons() const {
42 return BUTTON_OK
| BUTTON_CANCEL
;
45 base::string16
TestConfirmBubbleModel::GetButtonLabel(
46 BubbleButton button
) const {
47 return button
== BUTTON_OK
? base::ASCIIToUTF16("OK")
48 : base::ASCIIToUTF16("Cancel");
51 void TestConfirmBubbleModel::Accept() {
53 *accept_clicked_
= true;
56 void TestConfirmBubbleModel::Cancel() {
58 *cancel_clicked_
= true;
61 base::string16
TestConfirmBubbleModel::GetLinkText() const {
62 return base::ASCIIToUTF16("Link");
65 void TestConfirmBubbleModel::LinkClicked() {
67 *link_clicked_
= true;