| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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/content_settings/content_setting_changed_infobar_del
egate.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_changed_infobar_del
egate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 int icon, | 28 int icon, |
| 29 int message_text) | 29 int message_text) |
| 30 : ConfirmInfoBarDelegate(infobar_service), | 30 : ConfirmInfoBarDelegate(infobar_service), |
| 31 icon_(icon), | 31 icon_(icon), |
| 32 message_text_(message_text) { | 32 message_text_(message_text) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 ContentSettingChangedInfoBarDelegate::~ContentSettingChangedInfoBarDelegate() { | 35 ContentSettingChangedInfoBarDelegate::~ContentSettingChangedInfoBarDelegate() { |
| 36 } | 36 } |
| 37 | 37 |
| 38 gfx::Image* ContentSettingChangedInfoBarDelegate::GetIcon() const { | 38 int ContentSettingChangedInfoBarDelegate::GetIconID() const { |
| 39 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_); | 39 return icon_; |
| 40 } | 40 } |
| 41 | 41 |
| 42 InfoBarDelegate::Type ContentSettingChangedInfoBarDelegate::GetInfoBarType() | 42 InfoBarDelegate::Type ContentSettingChangedInfoBarDelegate::GetInfoBarType() |
| 43 const { | 43 const { |
| 44 return PAGE_ACTION_TYPE; | 44 return PAGE_ACTION_TYPE; |
| 45 } | 45 } |
| 46 | 46 |
| 47 string16 ContentSettingChangedInfoBarDelegate::GetMessageText() const { | 47 string16 ContentSettingChangedInfoBarDelegate::GetMessageText() const { |
| 48 return l10n_util::GetStringUTF16(message_text_); | 48 return l10n_util::GetStringUTF16(message_text_); |
| 49 } | 49 } |
| 50 | 50 |
| 51 int ContentSettingChangedInfoBarDelegate::GetButtons() const { | 51 int ContentSettingChangedInfoBarDelegate::GetButtons() const { |
| 52 return BUTTON_OK; | 52 return BUTTON_OK; |
| 53 } | 53 } |
| 54 | 54 |
| 55 string16 ContentSettingChangedInfoBarDelegate::GetButtonLabel( | 55 string16 ContentSettingChangedInfoBarDelegate::GetButtonLabel( |
| 56 InfoBarButton button) const { | 56 InfoBarButton button) const { |
| 57 DCHECK_EQ(BUTTON_OK, button); | 57 DCHECK_EQ(BUTTON_OK, button); |
| 58 return l10n_util::GetStringUTF16(IDS_CONTENT_SETTING_CHANGED_INFOBAR_BUTTON); | 58 return l10n_util::GetStringUTF16(IDS_CONTENT_SETTING_CHANGED_INFOBAR_BUTTON); |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool ContentSettingChangedInfoBarDelegate::Accept() { | 61 bool ContentSettingChangedInfoBarDelegate::Accept() { |
| 62 web_contents()->GetController().Reload(true); | 62 web_contents()->GetController().Reload(true); |
| 63 return true; | 63 return true; |
| 64 } | 64 } |
| OLD | NEW |