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

Side by Side Diff: chrome/browser/ui/auto_login_infobar_delegate.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/ui/auto_login_infobar_delegate.h" 5 #include "chrome/browser/ui/auto_login_infobar_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() { 172 AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() {
173 if (!button_pressed_) 173 if (!button_pressed_)
174 RecordHistogramAction(HISTOGRAM_IGNORED); 174 RecordHistogramAction(HISTOGRAM_IGNORED);
175 } 175 }
176 176
177 void AutoLoginInfoBarDelegate::InfoBarDismissed() { 177 void AutoLoginInfoBarDelegate::InfoBarDismissed() {
178 RecordHistogramAction(HISTOGRAM_DISMISSED); 178 RecordHistogramAction(HISTOGRAM_DISMISSED);
179 button_pressed_ = true; 179 button_pressed_ = true;
180 } 180 }
181 181
182 gfx::Image* AutoLoginInfoBarDelegate::GetIcon() const { 182 int AutoLoginInfoBarDelegate::GetIconID() const {
183 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 183 return IDR_INFOBAR_AUTOLOGIN;
184 IDR_INFOBAR_AUTOLOGIN);
185 } 184 }
186 185
187 InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() const { 186 InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() const {
188 return PAGE_ACTION_TYPE; 187 return PAGE_ACTION_TYPE;
189 } 188 }
190 189
191 AutoLoginInfoBarDelegate* 190 AutoLoginInfoBarDelegate*
192 AutoLoginInfoBarDelegate::AsAutoLoginInfoBarDelegate() { 191 AutoLoginInfoBarDelegate::AsAutoLoginInfoBarDelegate() {
193 return this; 192 return this;
194 } 193 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type); 227 DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type);
229 // owner() can be NULL when InfoBarService removes us. See 228 // owner() can be NULL when InfoBarService removes us. See
230 // |InfoBarDelegate::clear_owner|. 229 // |InfoBarDelegate::clear_owner|.
231 if (owner()) 230 if (owner())
232 owner()->RemoveInfoBar(this); 231 owner()->RemoveInfoBar(this);
233 } 232 }
234 233
235 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) { 234 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) {
236 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, HISTOGRAM_MAX); 235 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, HISTOGRAM_MAX);
237 } 236 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698