Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / test / test_confirm_bubble_model.cc
blob350eaa905faa82c30f296884ff1557040428394d
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,
13 bool* accept_clicked,
14 bool* cancel_clicked,
15 bool* link_clicked)
16 : model_deleted_(model_deleted),
17 accept_clicked_(accept_clicked),
18 cancel_clicked_(cancel_clicked),
19 link_clicked_(link_clicked) {
22 TestConfirmBubbleModel::~TestConfirmBubbleModel() {
23 if (model_deleted_)
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(
38 IDR_PRODUCT_LOGO_16);
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() {
52 if (accept_clicked_)
53 *accept_clicked_ = true;
56 void TestConfirmBubbleModel::Cancel() {
57 if (cancel_clicked_)
58 *cancel_clicked_ = true;
61 base::string16 TestConfirmBubbleModel::GetLinkText() const {
62 return base::ASCIIToUTF16("Link");
65 void TestConfirmBubbleModel::LinkClicked() {
66 if (link_clicked_)
67 *link_clicked_ = true;