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