| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 | 9 |
| 10 const char MockConfirmInfoBarDelegate::kMessage[] = "MockConfirmInfoBarMessage"; | 10 const char MockConfirmInfoBarDelegate::kMessage[] = "MockConfirmInfoBarMessage"; |
| 11 | 11 |
| 12 MockConfirmInfoBarDelegate::MockConfirmInfoBarDelegate() | 12 MockConfirmInfoBarDelegate::MockConfirmInfoBarDelegate(Owner* owner) |
| 13 : ConfirmInfoBarDelegate(NULL), | 13 : ConfirmInfoBarDelegate(NULL), |
| 14 owner_(owner), |
| 14 closes_on_action_(true), | 15 closes_on_action_(true), |
| 15 icon_accessed_(false), | 16 icon_accessed_(false), |
| 16 message_text_accessed_(false), | 17 message_text_accessed_(false), |
| 17 link_text_accessed_(false), | 18 link_text_accessed_(false), |
| 18 ok_clicked_(false), | 19 ok_clicked_(false), |
| 19 cancel_clicked_(false), | 20 cancel_clicked_(false), |
| 20 link_clicked_(false), | 21 link_clicked_(false) { |
| 21 closed_(false) { | |
| 22 } | 22 } |
| 23 | 23 |
| 24 MockConfirmInfoBarDelegate::~MockConfirmInfoBarDelegate() { | 24 MockConfirmInfoBarDelegate::~MockConfirmInfoBarDelegate() { |
| 25 } | 25 if (owner_) |
| 26 | 26 owner_->OnInfoBarDelegateClosed(); |
| 27 void MockConfirmInfoBarDelegate::InfoBarClosed() { | |
| 28 closed_ = true; | |
| 29 } | 27 } |
| 30 | 28 |
| 31 gfx::Image* MockConfirmInfoBarDelegate::GetIcon() const { | 29 gfx::Image* MockConfirmInfoBarDelegate::GetIcon() const { |
| 32 icon_accessed_ = true; | 30 icon_accessed_ = true; |
| 33 return NULL; | 31 return NULL; |
| 34 } | 32 } |
| 35 | 33 |
| 36 string16 MockConfirmInfoBarDelegate::GetMessageText() const { | 34 string16 MockConfirmInfoBarDelegate::GetMessageText() const { |
| 37 message_text_accessed_ = true; | 35 message_text_accessed_ = true; |
| 38 return ASCIIToUTF16(kMessage); | 36 return ASCIIToUTF16(kMessage); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 56 string16 MockConfirmInfoBarDelegate::GetLinkText() { | 54 string16 MockConfirmInfoBarDelegate::GetLinkText() { |
| 57 link_text_accessed_ = true; | 55 link_text_accessed_ = true; |
| 58 return string16(); | 56 return string16(); |
| 59 } | 57 } |
| 60 | 58 |
| 61 bool MockConfirmInfoBarDelegate::LinkClicked( | 59 bool MockConfirmInfoBarDelegate::LinkClicked( |
| 62 WindowOpenDisposition disposition) { | 60 WindowOpenDisposition disposition) { |
| 63 link_clicked_ = true; | 61 link_clicked_ = true; |
| 64 return closes_on_action_; | 62 return closes_on_action_; |
| 65 } | 63 } |
| OLD | NEW |