| 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 "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 void SavePasswordInfoBarDelegate::InfoBarDismissed() { | 143 void SavePasswordInfoBarDelegate::InfoBarDismissed() { |
| 144 DCHECK(form_to_save_.get()); | 144 DCHECK(form_to_save_.get()); |
| 145 infobar_response_ = password_manager::metrics_util::INFOBAR_DISMISSED; | 145 infobar_response_ = password_manager::metrics_util::INFOBAR_DISMISSED; |
| 146 } | 146 } |
| 147 | 147 |
| 148 base::string16 SavePasswordInfoBarDelegate::GetMessageText() const { | 148 base::string16 SavePasswordInfoBarDelegate::GetMessageText() const { |
| 149 return title_; | 149 return title_; |
| 150 } | 150 } |
| 151 | 151 |
| 152 gfx::Range SavePasswordInfoBarDelegate::GetMessageLinkRange() const { |
| 153 return title_link_range_; |
| 154 } |
| 155 |
| 152 base::string16 SavePasswordInfoBarDelegate::GetButtonLabel( | 156 base::string16 SavePasswordInfoBarDelegate::GetButtonLabel( |
| 153 InfoBarButton button) const { | 157 InfoBarButton button) const { |
| 154 return l10n_util::GetStringUTF16((button == BUTTON_OK) | 158 return l10n_util::GetStringUTF16((button == BUTTON_OK) |
| 155 ? IDS_PASSWORD_MANAGER_SAVE_BUTTON | 159 ? IDS_PASSWORD_MANAGER_SAVE_BUTTON |
| 156 : GetCancelButtonText(source_type_)); | 160 : GetCancelButtonText(source_type_)); |
| 157 } | 161 } |
| 158 | 162 |
| 159 bool SavePasswordInfoBarDelegate::Accept() { | 163 bool SavePasswordInfoBarDelegate::Accept() { |
| 160 DCHECK(form_to_save_.get()); | 164 DCHECK(form_to_save_.get()); |
| 161 form_to_save_->Save(); | 165 form_to_save_->Save(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 179 WindowOpenDisposition disposition) { | 183 WindowOpenDisposition disposition) { |
| 180 InfoBarService::WebContentsFromInfoBar(infobar()) | 184 InfoBarService::WebContentsFromInfoBar(infobar()) |
| 181 ->OpenURL(content::OpenURLParams( | 185 ->OpenURL(content::OpenURLParams( |
| 182 GURL(l10n_util::GetStringUTF16( | 186 GURL(l10n_util::GetStringUTF16( |
| 183 IDS_PASSWORD_MANAGER_SMART_LOCK_ARTICLE)), | 187 IDS_PASSWORD_MANAGER_SMART_LOCK_ARTICLE)), |
| 184 content::Referrer(), | 188 content::Referrer(), |
| 185 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 189 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 186 ui::PAGE_TRANSITION_LINK, false)); | 190 ui::PAGE_TRANSITION_LINK, false)); |
| 187 return true; | 191 return true; |
| 188 } | 192 } |
| OLD | NEW |