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

Side by Side Diff: chrome/browser/ssl/ssl_tab_helper.cc

Issue 15067008: [InfoBar] Add InfoBarDelegate::GetIconID() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming back to GetIcon() 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
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/ssl/ssl_tab_helper.h" 5 #include "chrome/browser/ssl/ssl_tab_helper.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 const string16& message, 52 const string16& message,
53 net::X509Certificate* cert); 53 net::X509Certificate* cert);
54 54
55 private: 55 private:
56 SSLCertResultInfoBarDelegate(InfoBarService* infobar_service, 56 SSLCertResultInfoBarDelegate(InfoBarService* infobar_service,
57 const string16& message, 57 const string16& message,
58 net::X509Certificate* cert); 58 net::X509Certificate* cert);
59 virtual ~SSLCertResultInfoBarDelegate(); 59 virtual ~SSLCertResultInfoBarDelegate();
60 60
61 // ConfirmInfoBarDelegate: 61 // ConfirmInfoBarDelegate:
62 virtual gfx::Image* GetIcon() const OVERRIDE; 62 virtual int GetIconID() const OVERRIDE;
63 virtual Type GetInfoBarType() const OVERRIDE; 63 virtual Type GetInfoBarType() const OVERRIDE;
64 virtual string16 GetMessageText() const OVERRIDE; 64 virtual string16 GetMessageText() const OVERRIDE;
65 virtual int GetButtons() const OVERRIDE; 65 virtual int GetButtons() const OVERRIDE;
66 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 66 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
67 virtual bool Accept() OVERRIDE; 67 virtual bool Accept() OVERRIDE;
68 68
69 string16 message_; 69 string16 message_;
70 scoped_refptr<net::X509Certificate> cert_; // The cert we added, if any. 70 scoped_refptr<net::X509Certificate> cert_; // The cert we added, if any.
71 71
72 DISALLOW_COPY_AND_ASSIGN(SSLCertResultInfoBarDelegate); 72 DISALLOW_COPY_AND_ASSIGN(SSLCertResultInfoBarDelegate);
(...skipping 17 matching lines...) Expand all
90 const string16& message, 90 const string16& message,
91 net::X509Certificate* cert) 91 net::X509Certificate* cert)
92 : ConfirmInfoBarDelegate(infobar_service), 92 : ConfirmInfoBarDelegate(infobar_service),
93 message_(message), 93 message_(message),
94 cert_(cert) { 94 cert_(cert) {
95 } 95 }
96 96
97 SSLCertResultInfoBarDelegate::~SSLCertResultInfoBarDelegate() { 97 SSLCertResultInfoBarDelegate::~SSLCertResultInfoBarDelegate() {
98 } 98 }
99 99
100 gfx::Image* SSLCertResultInfoBarDelegate::GetIcon() const { 100 int SSLCertResultInfoBarDelegate::GetIconID() const {
101 // TODO(davidben): use a more appropriate icon. 101 // TODO(davidben): use a more appropriate icon.
102 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 102 return IDR_INFOBAR_SAVE_PASSWORD;
103 IDR_INFOBAR_SAVE_PASSWORD);
104 } 103 }
105 104
106 InfoBarDelegate::Type SSLCertResultInfoBarDelegate::GetInfoBarType() const { 105 InfoBarDelegate::Type SSLCertResultInfoBarDelegate::GetInfoBarType() const {
107 return cert_.get() ? PAGE_ACTION_TYPE : WARNING_TYPE; 106 return cert_.get() ? PAGE_ACTION_TYPE : WARNING_TYPE;
108 } 107 }
109 108
110 string16 SSLCertResultInfoBarDelegate::GetMessageText() const { 109 string16 SSLCertResultInfoBarDelegate::GetMessageText() const {
111 return message_; 110 return message_;
112 } 111 }
113 112
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 SSLTabHelper::SSLAddCertData* 266 SSLTabHelper::SSLAddCertData*
268 SSLTabHelper::GetAddCertData(SSLAddCertHandler* handler) { 267 SSLTabHelper::GetAddCertData(SSLAddCertHandler* handler) {
269 // Find/create the slot. 268 // Find/create the slot.
270 linked_ptr<SSLAddCertData>& ptr_ref = 269 linked_ptr<SSLAddCertData>& ptr_ref =
271 request_id_to_add_cert_data_[handler->network_request_id()]; 270 request_id_to_add_cert_data_[handler->network_request_id()];
272 // Fill it if necessary. 271 // Fill it if necessary.
273 if (!ptr_ref.get()) 272 if (!ptr_ref.get())
274 ptr_ref.reset(new SSLAddCertData(web_contents_)); 273 ptr_ref.reset(new SSLAddCertData(web_contents_));
275 return ptr_ref.get(); 274 return ptr_ref.get();
276 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698