| 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/media_setting_changed_infobar_deleg
ate.h" | 5 #include "chrome/browser/ui/content_settings/media_setting_changed_infobar_deleg
ate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/infobars/infobar.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 10 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
| 11 #include "grit/theme_resources.h" | 12 #include "grit/theme_resources.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 void MediaSettingChangedInfoBarDelegate::Create( | 16 void MediaSettingChangedInfoBarDelegate::Create( |
| 16 InfoBarService* infobar_service) { | 17 InfoBarService* infobar_service) { |
| 17 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( | 18 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
| 18 new MediaSettingChangedInfoBarDelegate(infobar_service))); | 19 scoped_ptr<ConfirmInfoBarDelegate>( |
| 20 new MediaSettingChangedInfoBarDelegate()))); |
| 19 } | 21 } |
| 20 | 22 |
| 21 MediaSettingChangedInfoBarDelegate::MediaSettingChangedInfoBarDelegate( | 23 MediaSettingChangedInfoBarDelegate::MediaSettingChangedInfoBarDelegate() |
| 22 InfoBarService* infobar_service) | 24 : ConfirmInfoBarDelegate() { |
| 23 : ConfirmInfoBarDelegate(infobar_service) { | |
| 24 } | 25 } |
| 25 | 26 |
| 26 MediaSettingChangedInfoBarDelegate::~MediaSettingChangedInfoBarDelegate() { | 27 MediaSettingChangedInfoBarDelegate::~MediaSettingChangedInfoBarDelegate() { |
| 27 } | 28 } |
| 28 | 29 |
| 29 int MediaSettingChangedInfoBarDelegate::GetIconID() const { | 30 int MediaSettingChangedInfoBarDelegate::GetIconID() const { |
| 30 return IDR_INFOBAR_MEDIA_STREAM_CAMERA; | 31 return IDR_INFOBAR_MEDIA_STREAM_CAMERA; |
| 31 } | 32 } |
| 32 | 33 |
| 33 InfoBarDelegate::Type | 34 InfoBarDelegate::Type |
| (...skipping 13 matching lines...) Expand all Loading... |
| 47 string16 MediaSettingChangedInfoBarDelegate::GetButtonLabel( | 48 string16 MediaSettingChangedInfoBarDelegate::GetButtonLabel( |
| 48 InfoBarButton button) const { | 49 InfoBarButton button) const { |
| 49 DCHECK_EQ(BUTTON_OK, button); | 50 DCHECK_EQ(BUTTON_OK, button); |
| 50 return l10n_util::GetStringUTF16(IDS_CONTENT_SETTING_CHANGED_INFOBAR_BUTTON); | 51 return l10n_util::GetStringUTF16(IDS_CONTENT_SETTING_CHANGED_INFOBAR_BUTTON); |
| 51 } | 52 } |
| 52 | 53 |
| 53 bool MediaSettingChangedInfoBarDelegate::Accept() { | 54 bool MediaSettingChangedInfoBarDelegate::Accept() { |
| 54 web_contents()->GetController().Reload(true); | 55 web_contents()->GetController().Reload(true); |
| 55 return true; | 56 return true; |
| 56 } | 57 } |
| OLD | NEW |