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/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" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 if (!entry) { | 95 if (!entry) { |
96 // TODO(gcasto): Determine if fix for crbug.com/388246 is relevant here. | 96 // TODO(gcasto): Determine if fix for crbug.com/388246 is relevant here. |
97 return true; | 97 return true; |
98 } | 98 } |
99 // Do not fill nor save password when a user is signing in for sync. This | 99 // Do not fill nor save password when a user is signing in for sync. This |
100 // is because users need to remember their password if they are syncing as | 100 // is because users need to remember their password if they are syncing as |
101 // this is effectively their master password. | 101 // this is effectively their master password. |
102 return entry->GetURL().host() != chrome::kChromeUIChromeSigninHost; | 102 return entry->GetURL().host() != chrome::kChromeUIChromeSigninHost; |
103 } | 103 } |
104 | 104 |
105 bool ChromePasswordManagerClient::IsPasswordSyncAccountCredential( | 105 bool ChromePasswordManagerClient::IsSyncAccountCredential( |
106 const std::string& username, const std::string& origin) const { | 106 const std::string& username, const std::string& origin) const { |
107 return password_manager_sync_metrics::IsPasswordSyncAccountCredential( | 107 return password_manager_sync_metrics::IsSyncAccountCredential( |
108 profile_, username, origin); | 108 profile_, username, origin); |
109 } | 109 } |
110 | 110 |
111 void ChromePasswordManagerClient::PromptUserToSavePassword( | 111 void ChromePasswordManagerClient::PromptUserToSavePassword( |
112 password_manager::PasswordFormManager* form_to_save) { | 112 password_manager::PasswordFormManager* form_to_save) { |
113 if (IsTheHotNewBubbleUIEnabled()) { | 113 if (IsTheHotNewBubbleUIEnabled()) { |
114 ManagePasswordsUIController* manage_passwords_ui_controller = | 114 ManagePasswordsUIController* manage_passwords_ui_controller = |
115 ManagePasswordsUIController::FromWebContents(web_contents()); | 115 ManagePasswordsUIController::FromWebContents(web_contents()); |
116 manage_passwords_ui_controller->OnPasswordSubmitted(form_to_save); | 116 manage_passwords_ui_controller->OnPasswordSubmitted(form_to_save); |
117 } else { | 117 } else { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 if (command_line->HasSwitch( | 370 if (command_line->HasSwitch( |
371 password_manager::switches::kEnableManagerForSyncSignin)) | 371 password_manager::switches::kEnableManagerForSyncSignin)) |
372 return true; | 372 return true; |
373 | 373 |
374 // Default is enabled. | 374 // Default is enabled. |
375 std::string group_name = | 375 std::string group_name = |
376 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); | 376 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); |
377 return group_name != "Disabled"; | 377 return group_name != "Disabled"; |
378 } | 378 } |
OLD | NEW |