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/android/infobars/auto_login_prompter.h" | 5 #include "chrome/browser/ui/android/infobars/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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // relevant notifications; it will delete itself. | 90 // relevant notifications; it will delete itself. |
91 new AutoLoginPrompter(web_contents, params, url); | 91 new AutoLoginPrompter(web_contents, params, url); |
92 } | 92 } |
93 | 93 |
94 void AutoLoginPrompter::DidStopLoading( | 94 void AutoLoginPrompter::DidStopLoading( |
95 content::RenderViewHost* render_view_host) { | 95 content::RenderViewHost* render_view_host) { |
96 AddInfoBarToWebContents(); | 96 AddInfoBarToWebContents(); |
97 delete this; | 97 delete this; |
98 } | 98 } |
99 | 99 |
100 void AutoLoginPrompter::WebContentsDestroyed(WebContents* web_contents) { | 100 void AutoLoginPrompter::WebContentsDestroyed() { |
101 // The WebContents was destroyed before the navigation completed. | 101 // The WebContents was destroyed before the navigation completed. |
102 delete this; | 102 delete this; |
103 } | 103 } |
104 | 104 |
105 void AutoLoginPrompter::AddInfoBarToWebContents() { | 105 void AutoLoginPrompter::AddInfoBarToWebContents() { |
106 if (!infobar_shown_) | 106 if (!infobar_shown_) |
107 infobar_shown_ = AutoLoginInfoBarDelegate::Create(web_contents(), params_); | 107 infobar_shown_ = AutoLoginInfoBarDelegate::Create(web_contents(), params_); |
108 } | 108 } |
OLD | NEW |