| 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_android
.h" | 5 #include "chrome/browser/password_manager/save_password_infobar_delegate_android
.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/sync/profile_sync_service_factory.h" | 13 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 14 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" | 14 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
| 15 #include "chrome/grit/chromium_strings.h" | 15 #include "chrome/grit/chromium_strings.h" |
| 16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 17 #include "components/browser_sync/browser/profile_sync_service.h" | 17 #include "components/browser_sync/browser/profile_sync_service.h" |
| 18 #include "components/infobars/core/infobar.h" | 18 #include "components/infobars/core/infobar.h" |
| 19 #include "components/password_manager/core/browser/password_bubble_experiment.h" | 19 #include "components/password_manager/core/browser/password_bubble_experiment.h" |
| 20 #include "components/password_manager/core/browser/password_manager_client.h" | |
| 21 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 22 #include "grit/theme_resources.h" | 21 #include "grit/theme_resources.h" |
| 23 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "url/origin.h" | 23 #include "url/origin.h" |
| 25 | 24 |
| 26 // static | 25 // static |
| 27 void SavePasswordInfoBarDelegate::Create( | 26 void SavePasswordInfoBarDelegate::Create( |
| 28 content::WebContents* web_contents, | 27 content::WebContents* web_contents, |
| 29 std::unique_ptr<password_manager::PasswordFormManager> form_to_save) { | 28 std::unique_ptr<password_manager::PasswordFormManager> form_to_save) { |
| 30 Profile* profile = | 29 Profile* profile = |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 infobar_response_ = password_manager::metrics_util::CLICKED_SAVE; | 108 infobar_response_ = password_manager::metrics_util::CLICKED_SAVE; |
| 110 return true; | 109 return true; |
| 111 } | 110 } |
| 112 | 111 |
| 113 bool SavePasswordInfoBarDelegate::Cancel() { | 112 bool SavePasswordInfoBarDelegate::Cancel() { |
| 114 DCHECK(form_to_save_.get()); | 113 DCHECK(form_to_save_.get()); |
| 115 form_to_save_->PermanentlyBlacklist(); | 114 form_to_save_->PermanentlyBlacklist(); |
| 116 infobar_response_ = password_manager::metrics_util::CLICKED_NEVER; | 115 infobar_response_ = password_manager::metrics_util::CLICKED_NEVER; |
| 117 return true; | 116 return true; |
| 118 } | 117 } |
| OLD | NEW |