| 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_prompter.h" | 5 #include "chrome/browser/ui/auto_login_prompter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 new AutoLoginPrompter(web_contents, params); | 171 new AutoLoginPrompter(web_contents, params); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void AutoLoginPrompter::Observe(int type, | 174 void AutoLoginPrompter::Observe(int type, |
| 175 const content::NotificationSource& source, | 175 const content::NotificationSource& source, |
| 176 const content::NotificationDetails& details) { | 176 const content::NotificationDetails& details) { |
| 177 if (type == content::NOTIFICATION_LOAD_STOP) { | 177 if (type == content::NOTIFICATION_LOAD_STOP) { |
| 178 InfoBarService* infobar_service = | 178 InfoBarService* infobar_service = |
| 179 InfoBarService::FromWebContents(web_contents_); | 179 InfoBarService::FromWebContents(web_contents_); |
| 180 // |infobar_service| is NULL for WebContents hosted in WebDialog. | 180 // |infobar_service| is NULL for WebContents hosted in WebDialog. |
| 181 if (infobar_service) { | 181 if (infobar_service) |
| 182 infobar_service->AddInfoBar( | 182 AutoLoginInfoBarDelegate::Create(infobar_service, params_); |
| 183 new AutoLoginInfoBarDelegate(infobar_service, params_)); | |
| 184 } | |
| 185 } | 183 } |
| 186 // Either we couldn't add the infobar, we added the infobar, or the tab | 184 // Either we couldn't add the infobar, we added the infobar, or the tab |
| 187 // contents was destroyed before the navigation completed. In any case | 185 // contents was destroyed before the navigation completed. In any case |
| 188 // there's no reason to live further. | 186 // there's no reason to live further. |
| 189 delete this; | 187 delete this; |
| 190 } | 188 } |
| OLD | NEW |