| 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/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 20 matching lines...) Expand all Loading... |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/common/referrer.h" | 32 #include "content/public/common/referrer.h" |
| 33 #include "google_apis/gaia/gaia_constants.h" | 33 #include "google_apis/gaia/gaia_constants.h" |
| 34 #include "google_apis/gaia/gaia_urls.h" | 34 #include "google_apis/gaia/gaia_urls.h" |
| 35 #include "grit/chromium_strings.h" | 35 #include "grit/chromium_strings.h" |
| 36 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
| 37 #include "grit/theme_resources.h" | 37 #include "grit/theme_resources.h" |
| 38 #include "net/base/escape.h" | 38 #include "net/base/escape.h" |
| 39 #include "net/url_request/url_request.h" | 39 #include "net/url_request/url_request.h" |
| 40 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "ui/base/resource/resource_bundle.h" | |
| 42 | 41 |
| 43 using content::NavigationController; | 42 using content::NavigationController; |
| 44 using content::NotificationSource; | 43 using content::NotificationSource; |
| 45 using content::NotificationDetails; | 44 using content::NotificationDetails; |
| 46 | 45 |
| 47 | 46 |
| 48 // AutoLoginRedirector -------------------------------------------------------- | 47 // AutoLoginRedirector -------------------------------------------------------- |
| 49 | 48 |
| 50 namespace { | 49 namespace { |
| 51 | 50 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() { | 171 AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() { |
| 173 if (!button_pressed_) | 172 if (!button_pressed_) |
| 174 RecordHistogramAction(HISTOGRAM_IGNORED); | 173 RecordHistogramAction(HISTOGRAM_IGNORED); |
| 175 } | 174 } |
| 176 | 175 |
| 177 void AutoLoginInfoBarDelegate::InfoBarDismissed() { | 176 void AutoLoginInfoBarDelegate::InfoBarDismissed() { |
| 178 RecordHistogramAction(HISTOGRAM_DISMISSED); | 177 RecordHistogramAction(HISTOGRAM_DISMISSED); |
| 179 button_pressed_ = true; | 178 button_pressed_ = true; |
| 180 } | 179 } |
| 181 | 180 |
| 182 gfx::Image* AutoLoginInfoBarDelegate::GetIcon() const { | 181 int AutoLoginInfoBarDelegate::GetIconID() const { |
| 183 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 182 return IDR_INFOBAR_AUTOLOGIN; |
| 184 IDR_INFOBAR_AUTOLOGIN); | |
| 185 } | 183 } |
| 186 | 184 |
| 187 InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() const { | 185 InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() const { |
| 188 return PAGE_ACTION_TYPE; | 186 return PAGE_ACTION_TYPE; |
| 189 } | 187 } |
| 190 | 188 |
| 191 AutoLoginInfoBarDelegate* | 189 AutoLoginInfoBarDelegate* |
| 192 AutoLoginInfoBarDelegate::AsAutoLoginInfoBarDelegate() { | 190 AutoLoginInfoBarDelegate::AsAutoLoginInfoBarDelegate() { |
| 193 return this; | 191 return this; |
| 194 } | 192 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type); | 226 DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type); |
| 229 // owner() can be NULL when InfoBarService removes us. See | 227 // owner() can be NULL when InfoBarService removes us. See |
| 230 // |InfoBarDelegate::clear_owner|. | 228 // |InfoBarDelegate::clear_owner|. |
| 231 if (owner()) | 229 if (owner()) |
| 232 owner()->RemoveInfoBar(this); | 230 owner()->RemoveInfoBar(this); |
| 233 } | 231 } |
| 234 | 232 |
| 235 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) { | 233 void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) { |
| 236 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, HISTOGRAM_MAX); | 234 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, HISTOGRAM_MAX); |
| 237 } | 235 } |
| OLD | NEW |