| 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/password_manager/save_password_infobar_delegate.h" | 5 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/infobars/infobar.h" | 9 #include "chrome/browser/infobars/infobar.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // static | 102 // static |
| 103 scoped_ptr<InfoBar> SavePasswordInfoBarDelegate::CreateInfoBar( | 103 scoped_ptr<InfoBar> SavePasswordInfoBarDelegate::CreateInfoBar( |
| 104 scoped_ptr<SavePasswordInfoBarDelegate> delegate) { | 104 scoped_ptr<SavePasswordInfoBarDelegate> delegate) { |
| 105 return ConfirmInfoBarDelegate::CreateInfoBar( | 105 return ConfirmInfoBarDelegate::CreateInfoBar( |
| 106 delegate.PassAs<ConfirmInfoBarDelegate>()); | 106 delegate.PassAs<ConfirmInfoBarDelegate>()); |
| 107 } | 107 } |
| 108 #endif | 108 #endif |
| 109 | 109 |
| 110 bool SavePasswordInfoBarDelegate::ShouldExpire( | 110 bool SavePasswordInfoBarDelegate::ShouldExpire( |
| 111 const content::LoadCommittedDetails& details) const { | 111 const NavigationDetails& details) const { |
| 112 bool is_not_redirect = !(details.entry->GetTransitionType() & | 112 return !details.is_redirect && InfoBarDelegate::ShouldExpire(details); |
| 113 content::PAGE_TRANSITION_IS_REDIRECT_MASK); | |
| 114 return is_not_redirect && InfoBarDelegate::ShouldExpire(details); | |
| 115 } | 113 } |
| 116 | 114 |
| 117 int SavePasswordInfoBarDelegate::GetIconID() const { | 115 int SavePasswordInfoBarDelegate::GetIconID() const { |
| 118 return IDR_INFOBAR_SAVE_PASSWORD; | 116 return IDR_INFOBAR_SAVE_PASSWORD; |
| 119 } | 117 } |
| 120 | 118 |
| 121 InfoBarDelegate::Type SavePasswordInfoBarDelegate::GetInfoBarType() const { | 119 InfoBarDelegate::Type SavePasswordInfoBarDelegate::GetInfoBarType() const { |
| 122 return PAGE_ACTION_TYPE; | 120 return PAGE_ACTION_TYPE; |
| 123 } | 121 } |
| 124 | 122 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 148 | 146 |
| 149 void SavePasswordInfoBarDelegate::InfoBarDismissed() { | 147 void SavePasswordInfoBarDelegate::InfoBarDismissed() { |
| 150 DCHECK(form_to_save_.get()); | 148 DCHECK(form_to_save_.get()); |
| 151 infobar_response_ = INFOBAR_DISMISSED; | 149 infobar_response_ = INFOBAR_DISMISSED; |
| 152 } | 150 } |
| 153 | 151 |
| 154 InfoBarDelegate::InfoBarAutomationType | 152 InfoBarDelegate::InfoBarAutomationType |
| 155 SavePasswordInfoBarDelegate::GetInfoBarAutomationType() const { | 153 SavePasswordInfoBarDelegate::GetInfoBarAutomationType() const { |
| 156 return PASSWORD_INFOBAR; | 154 return PASSWORD_INFOBAR; |
| 157 } | 155 } |
| OLD | NEW |