Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / browser / ui / test / test_confirm_bubble_model.cc
blob0da8898192c493ac8fe8403df331b9288e1bd149
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,
11 bool* accept_clicked,
12 bool* cancel_clicked,
13 bool* link_clicked)
14 : model_deleted_(model_deleted),
15 accept_clicked_(accept_clicked),
16 cancel_clicked_(cancel_clicked),
17 link_clicked_(link_clicked) {
20 TestConfirmBubbleModel::~TestConfirmBubbleModel() {
21 if (model_deleted_)
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() {
44 if (accept_clicked_)
45 *accept_clicked_ = true;
48 void TestConfirmBubbleModel::Cancel() {
49 if (cancel_clicked_)
50 *cancel_clicked_ = true;
53 base::string16 TestConfirmBubbleModel::GetLinkText() const {
54 return base::ASCIIToUTF16("Link");
57 void TestConfirmBubbleModel::LinkClicked() {
58 if (link_clicked_)
59 *link_clicked_ = true;