| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h" | 5 #include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 | 8 |
| 9 const char MockConfirmInfoBarDelegate::kMessage[] = "MockConfirmInfoBarMessage"; | 9 const char MockConfirmInfoBarDelegate::kMessage[] = "MockConfirmInfoBarMessage"; |
| 10 | 10 |
| 11 MockConfirmInfoBarDelegate::MockConfirmInfoBarDelegate(Owner* owner) | 11 MockConfirmInfoBarDelegate::MockConfirmInfoBarDelegate(Owner* owner) |
| 12 : ConfirmInfoBarDelegate(), | 12 : ConfirmInfoBarDelegate(), |
| 13 owner_(owner), | 13 owner_(owner), |
| 14 closes_on_action_(true), | 14 closes_on_action_(true), |
| 15 icon_accessed_(false), | 15 icon_accessed_(false), |
| 16 message_text_accessed_(false), | 16 message_text_accessed_(false), |
| 17 link_text_accessed_(false), | 17 link_text_accessed_(false), |
| 18 ok_clicked_(false), | 18 ok_clicked_(false), |
| 19 cancel_clicked_(false), | 19 cancel_clicked_(false), |
| 20 link_clicked_(false) { | 20 link_clicked_(false) { |
| 21 } | 21 } |
| 22 | 22 |
| 23 MockConfirmInfoBarDelegate::~MockConfirmInfoBarDelegate() { | 23 MockConfirmInfoBarDelegate::~MockConfirmInfoBarDelegate() { |
| 24 if (owner_) | 24 if (owner_) |
| 25 owner_->OnInfoBarDelegateClosed(this); | 25 owner_->OnInfoBarDelegateClosed(this); |
| 26 } | 26 } |
| 27 | 27 |
| 28 std::string MockConfirmInfoBarDelegate::GetIdentifier() const { |
| 29 return "MockConfirmInfoBarDelegate"; |
| 30 } |
| 31 |
| 28 int MockConfirmInfoBarDelegate::GetIconId() const { | 32 int MockConfirmInfoBarDelegate::GetIconId() const { |
| 29 icon_accessed_ = true; | 33 icon_accessed_ = true; |
| 30 return kNoIconID; | 34 return kNoIconID; |
| 31 } | 35 } |
| 32 | 36 |
| 33 base::string16 MockConfirmInfoBarDelegate::GetMessageText() const { | 37 base::string16 MockConfirmInfoBarDelegate::GetMessageText() const { |
| 34 message_text_accessed_ = true; | 38 message_text_accessed_ = true; |
| 35 return base::ASCIIToUTF16(kMessage); | 39 return base::ASCIIToUTF16(kMessage); |
| 36 } | 40 } |
| 37 | 41 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 53 base::string16 MockConfirmInfoBarDelegate::GetLinkText() const { | 57 base::string16 MockConfirmInfoBarDelegate::GetLinkText() const { |
| 54 link_text_accessed_ = true; | 58 link_text_accessed_ = true; |
| 55 return base::string16(); | 59 return base::string16(); |
| 56 } | 60 } |
| 57 | 61 |
| 58 bool MockConfirmInfoBarDelegate::LinkClicked( | 62 bool MockConfirmInfoBarDelegate::LinkClicked( |
| 59 WindowOpenDisposition disposition) { | 63 WindowOpenDisposition disposition) { |
| 60 link_clicked_ = true; | 64 link_clicked_ = true; |
| 61 return closes_on_action_; | 65 return closes_on_action_; |
| 62 } | 66 } |
| OLD | NEW |