Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 582833005: Save password infobar should only work on schemes on which the bubble does (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/browser/browsing_data/browsing_data_helper.h"
13 #include "chrome/browser/password_manager/password_manager_util.h" 14 #include "chrome/browser/password_manager/password_manager_util.h"
14 #include "chrome/browser/password_manager/password_store_factory.h" 15 #include "chrome/browser/password_manager/password_store_factory.h"
15 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" 16 #include "chrome/browser/password_manager/save_password_infobar_delegate.h"
16 #include "chrome/browser/password_manager/sync_metrics.h" 17 #include "chrome/browser/password_manager/sync_metrics.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/sync/profile_sync_service.h" 19 #include "chrome/browser/sync/profile_sync_service.h"
19 #include "chrome/browser/sync/profile_sync_service_factory.h" 20 #include "chrome/browser/sync/profile_sync_service_factory.h"
20 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h " 21 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h "
21 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" 22 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
22 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 sync_credential_was_filtered_); 148 sync_credential_was_filtered_);
148 sync_credential_was_filtered_ = false; 149 sync_credential_was_filtered_ = false;
149 } 150 }
150 151
151 void ChromePasswordManagerClient::PromptUserToSavePassword( 152 void ChromePasswordManagerClient::PromptUserToSavePassword(
152 scoped_ptr<password_manager::PasswordFormManager> form_to_save) { 153 scoped_ptr<password_manager::PasswordFormManager> form_to_save) {
153 if (IsTheHotNewBubbleUIEnabled()) { 154 if (IsTheHotNewBubbleUIEnabled()) {
154 ManagePasswordsUIController* manage_passwords_ui_controller = 155 ManagePasswordsUIController* manage_passwords_ui_controller =
155 ManagePasswordsUIController::FromWebContents(web_contents()); 156 ManagePasswordsUIController::FromWebContents(web_contents());
156 manage_passwords_ui_controller->OnPasswordSubmitted(form_to_save.Pass()); 157 manage_passwords_ui_controller->OnPasswordSubmitted(form_to_save.Pass());
157 } else { 158 } else if (BrowsingDataHelper::IsWebScheme(
vabr (Chromium) 2014/09/19 13:18:10 While this will solve the current issue, please co
Sunil Ratnu 2014/09/24 15:15:37 Done.
159 web_contents()->GetLastCommittedURL().scheme())) {
160 // Save password infobar should only work on schemes on which the bubble
161 // does (in particular, should not work on file://)
158 std::string uma_histogram_suffix( 162 std::string uma_histogram_suffix(
159 password_manager::metrics_util::GroupIdToString( 163 password_manager::metrics_util::GroupIdToString(
160 password_manager::metrics_util::MonitoredDomainGroupId( 164 password_manager::metrics_util::MonitoredDomainGroupId(
161 form_to_save->realm(), GetPrefs()))); 165 form_to_save->realm(), GetPrefs())));
162 SavePasswordInfoBarDelegate::Create( 166 SavePasswordInfoBarDelegate::Create(
163 web_contents(), form_to_save.Pass(), uma_histogram_suffix); 167 web_contents(), form_to_save.Pass(), uma_histogram_suffix);
164 } 168 }
165 } 169 }
166 170
167 void ChromePasswordManagerClient::AutomaticPasswordSave( 171 void ChromePasswordManagerClient::AutomaticPasswordSave(
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 546
543 if (group_name == "DisallowSyncCredentialsForReauth") { 547 if (group_name == "DisallowSyncCredentialsForReauth") {
544 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; 548 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH;
545 } else if (group_name == "DisallowSyncCredentials") { 549 } else if (group_name == "DisallowSyncCredentials") {
546 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; 550 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS;
547 } else { 551 } else {
548 // Allow by default. 552 // Allow by default.
549 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; 553 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS;
550 } 554 }
551 } 555 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698