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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/api/infobars/infobar_service.h" | 9 #include "chrome/browser/api/infobars/infobar_service.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
12 #include "grit/theme_resources.h" | 12 #include "grit/theme_resources.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 | 15 |
| 16 // static |
| 17 void WebsiteSettingsInfobarDelegate::Create(InfoBarService* infobar_service) { |
| 18 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| 19 new WebsiteSettingsInfobarDelegate(infobar_service))); |
| 20 } |
| 21 |
16 WebsiteSettingsInfobarDelegate::WebsiteSettingsInfobarDelegate( | 22 WebsiteSettingsInfobarDelegate::WebsiteSettingsInfobarDelegate( |
17 InfoBarService* infobar_service) | 23 InfoBarService* infobar_service) |
18 : ConfirmInfoBarDelegate(infobar_service) { | 24 : ConfirmInfoBarDelegate(infobar_service) { |
19 } | 25 } |
20 | 26 |
21 gfx::Image* WebsiteSettingsInfobarDelegate::GetIcon() const { | 27 gfx::Image* WebsiteSettingsInfobarDelegate::GetIcon() const { |
22 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 28 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
23 IDR_INFOBAR_ALT_NAV_URL); | 29 IDR_INFOBAR_ALT_NAV_URL); |
24 } | 30 } |
25 | 31 |
(...skipping 12 matching lines...) Expand all Loading... |
38 string16 WebsiteSettingsInfobarDelegate::GetButtonLabel( | 44 string16 WebsiteSettingsInfobarDelegate::GetButtonLabel( |
39 InfoBarButton button) const { | 45 InfoBarButton button) const { |
40 DCHECK_EQ(BUTTON_OK, button); | 46 DCHECK_EQ(BUTTON_OK, button); |
41 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_BUTTON); | 47 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_BUTTON); |
42 } | 48 } |
43 | 49 |
44 bool WebsiteSettingsInfobarDelegate::Accept() { | 50 bool WebsiteSettingsInfobarDelegate::Accept() { |
45 owner()->GetWebContents()->GetController().Reload(true); | 51 owner()->GetWebContents()->GetController().Reload(true); |
46 return true; | 52 return true; |
47 } | 53 } |
OLD | NEW |