| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // service. | 130 // service. |
| 131 InfoBarService* infobar_service = | 131 InfoBarService* infobar_service = |
| 132 InfoBarService::FromWebContents(web_contents); | 132 InfoBarService::FromWebContents(web_contents); |
| 133 if (!infobar_service) | 133 if (!infobar_service) |
| 134 return false; | 134 return false; |
| 135 | 135 |
| 136 Profile* profile = | 136 Profile* profile = |
| 137 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 137 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 138 typedef AutoLoginInfoBarDelegate Delegate; | 138 typedef AutoLoginInfoBarDelegate Delegate; |
| 139 return !!infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 139 return !!infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
| 140 infobar_service, |
| 140 scoped_ptr<ConfirmInfoBarDelegate>(new Delegate(params, profile)))); | 141 scoped_ptr<ConfirmInfoBarDelegate>(new Delegate(params, profile)))); |
| 141 } | 142 } |
| 142 | 143 |
| 143 AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(const Params& params, | 144 AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(const Params& params, |
| 144 Profile* profile) | 145 Profile* profile) |
| 145 : ConfirmInfoBarDelegate(), | 146 : ConfirmInfoBarDelegate(), |
| 146 params_(params), | 147 params_(params), |
| 147 profile_(profile), | 148 profile_(profile), |
| 148 button_pressed_(false) { | 149 button_pressed_(false) { |
| 149 RecordHistogramAction(SHOWN); | 150 RecordHistogramAction(SHOWN); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 RecordHistogramAction(REJECTED); | 223 RecordHistogramAction(REJECTED); |
| 223 button_pressed_ = true; | 224 button_pressed_ = true; |
| 224 return true; | 225 return true; |
| 225 } | 226 } |
| 226 | 227 |
| 227 void AutoLoginInfoBarDelegate::GoogleSignedOut( | 228 void AutoLoginInfoBarDelegate::GoogleSignedOut( |
| 228 const std::string& account_id, | 229 const std::string& account_id, |
| 229 const std::string& username) { | 230 const std::string& username) { |
| 230 infobar()->RemoveSelf(); | 231 infobar()->RemoveSelf(); |
| 231 } | 232 } |
| OLD | NEW |