Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc

Issue 15067008: [InfoBar] Add InfoBarDelegate::GetIconID() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit fixes redux Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings_infobar_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/infobars/infobar_service.h" 9 #include "chrome/browser/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"
15 14
16 // static 15 // static
17 void WebsiteSettingsInfobarDelegate::Create(InfoBarService* infobar_service) { 16 void WebsiteSettingsInfobarDelegate::Create(InfoBarService* infobar_service) {
18 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( 17 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
19 new WebsiteSettingsInfobarDelegate(infobar_service))); 18 new WebsiteSettingsInfobarDelegate(infobar_service)));
20 } 19 }
21 20
22 WebsiteSettingsInfobarDelegate::WebsiteSettingsInfobarDelegate( 21 WebsiteSettingsInfobarDelegate::WebsiteSettingsInfobarDelegate(
23 InfoBarService* infobar_service) 22 InfoBarService* infobar_service)
24 : ConfirmInfoBarDelegate(infobar_service) { 23 : ConfirmInfoBarDelegate(infobar_service) {
25 } 24 }
26 25
27 gfx::Image* WebsiteSettingsInfobarDelegate::GetIcon() const { 26 int WebsiteSettingsInfobarDelegate::GetIconID() const {
28 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 27 return IDR_INFOBAR_ALT_NAV_URL;
29 IDR_INFOBAR_ALT_NAV_URL);
30 } 28 }
31 29
32 InfoBarDelegate::Type WebsiteSettingsInfobarDelegate::GetInfoBarType() const { 30 InfoBarDelegate::Type WebsiteSettingsInfobarDelegate::GetInfoBarType() const {
33 return PAGE_ACTION_TYPE; 31 return PAGE_ACTION_TYPE;
34 } 32 }
35 33
36 string16 WebsiteSettingsInfobarDelegate::GetMessageText() const { 34 string16 WebsiteSettingsInfobarDelegate::GetMessageText() const {
37 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_TEXT); 35 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_TEXT);
38 } 36 }
39 37
40 int WebsiteSettingsInfobarDelegate::GetButtons() const { 38 int WebsiteSettingsInfobarDelegate::GetButtons() const {
41 return BUTTON_OK; 39 return BUTTON_OK;
42 } 40 }
43 41
44 string16 WebsiteSettingsInfobarDelegate::GetButtonLabel( 42 string16 WebsiteSettingsInfobarDelegate::GetButtonLabel(
45 InfoBarButton button) const { 43 InfoBarButton button) const {
46 DCHECK_EQ(BUTTON_OK, button); 44 DCHECK_EQ(BUTTON_OK, button);
47 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_BUTTON); 45 return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_BUTTON);
48 } 46 }
49 47
50 bool WebsiteSettingsInfobarDelegate::Accept() { 48 bool WebsiteSettingsInfobarDelegate::Accept() {
51 web_contents()->GetController().Reload(true); 49 web_contents()->GetController().Reload(true);
52 return true; 50 return true;
53 } 51 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698