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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ChromePasswordManagerClient::ChromePasswordManagerClient( | 56 ChromePasswordManagerClient::ChromePasswordManagerClient( |
57 content::WebContents* web_contents) | 57 content::WebContents* web_contents) |
58 : content::WebContentsObserver(web_contents), | 58 : content::WebContentsObserver(web_contents), |
59 driver_(web_contents, this), | 59 driver_(web_contents, this), |
60 observer_(NULL), | 60 observer_(NULL), |
61 weak_factory_(this), | 61 weak_factory_(this), |
62 logger_(NULL) {} | 62 logger_(NULL) {} |
63 | 63 |
64 ChromePasswordManagerClient::~ChromePasswordManagerClient() {} | 64 ChromePasswordManagerClient::~ChromePasswordManagerClient() {} |
65 | 65 |
| 66 bool ChromePasswordManagerClient::IsAutomaticPasswordSavingEnabled() const { |
| 67 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 68 password_manager::switches::kEnableAutomaticPasswordSaving); |
| 69 } |
| 70 |
66 void ChromePasswordManagerClient::PromptUserToSavePassword( | 71 void ChromePasswordManagerClient::PromptUserToSavePassword( |
67 password_manager::PasswordFormManager* form_to_save) { | 72 password_manager::PasswordFormManager* form_to_save) { |
68 if (IsTheHotNewBubbleUIEnabled()) { | 73 if (IsTheHotNewBubbleUIEnabled()) { |
69 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = | 74 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = |
70 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); | 75 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); |
71 if (manage_passwords_bubble_ui_controller) { | 76 if (manage_passwords_bubble_ui_controller) { |
72 manage_passwords_bubble_ui_controller->OnPasswordSubmitted(form_to_save); | 77 manage_passwords_bubble_ui_controller->OnPasswordSubmitted(form_to_save); |
73 } else { | 78 } else { |
74 delete form_to_save; | 79 delete form_to_save; |
75 } | 80 } |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 web_contents(), | 289 web_contents(), |
285 web_contents()->GetView()->GetNativeView()); | 290 web_contents()->GetView()->GetNativeView()); |
286 popup_controller_->Show(false /* display_password */); | 291 popup_controller_->Show(false /* display_password */); |
287 #endif // #if defined(USE_AURA) | 292 #endif // #if defined(USE_AURA) |
288 } | 293 } |
289 | 294 |
290 void ChromePasswordManagerClient::CommitFillPasswordForm( | 295 void ChromePasswordManagerClient::CommitFillPasswordForm( |
291 autofill::PasswordFormFillData* data) { | 296 autofill::PasswordFormFillData* data) { |
292 driver_.FillPasswordForm(*data); | 297 driver_.FillPasswordForm(*data); |
293 } | 298 } |
OLD | NEW |