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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 new ChromePasswordManagerClient(contents, autofill_client)); | 61 new ChromePasswordManagerClient(contents, autofill_client)); |
62 } | 62 } |
63 | 63 |
64 ChromePasswordManagerClient::ChromePasswordManagerClient( | 64 ChromePasswordManagerClient::ChromePasswordManagerClient( |
65 content::WebContents* web_contents, | 65 content::WebContents* web_contents, |
66 autofill::AutofillClient* autofill_client) | 66 autofill::AutofillClient* autofill_client) |
67 : content::WebContentsObserver(web_contents), | 67 : content::WebContentsObserver(web_contents), |
68 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), | 68 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), |
69 driver_(web_contents, this, autofill_client), | 69 driver_(web_contents, this, autofill_client), |
70 observer_(NULL), | 70 observer_(NULL), |
71 weak_factory_(this), | |
72 can_use_log_router_(false), | 71 can_use_log_router_(false), |
73 autofill_sync_state_(ALLOW_SYNC_CREDENTIALS), | 72 autofill_sync_state_(ALLOW_SYNC_CREDENTIALS), |
74 sync_credential_was_filtered_(false) { | 73 sync_credential_was_filtered_(false), |
| 74 weak_factory_(this) { |
75 PasswordManagerInternalsService* service = | 75 PasswordManagerInternalsService* service = |
76 PasswordManagerInternalsServiceFactory::GetForBrowserContext(profile_); | 76 PasswordManagerInternalsServiceFactory::GetForBrowserContext(profile_); |
77 if (service) | 77 if (service) |
78 can_use_log_router_ = service->RegisterClient(this); | 78 can_use_log_router_ = service->RegisterClient(this); |
79 SetUpAutofillSyncState(); | 79 SetUpAutofillSyncState(); |
80 } | 80 } |
81 | 81 |
82 ChromePasswordManagerClient::~ChromePasswordManagerClient() { | 82 ChromePasswordManagerClient::~ChromePasswordManagerClient() { |
83 PasswordManagerInternalsService* service = | 83 PasswordManagerInternalsService* service = |
84 PasswordManagerInternalsServiceFactory::GetForBrowserContext(profile_); | 84 PasswordManagerInternalsServiceFactory::GetForBrowserContext(profile_); |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 542 |
543 if (group_name == "DisallowSyncCredentialsForReauth") { | 543 if (group_name == "DisallowSyncCredentialsForReauth") { |
544 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; | 544 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; |
545 } else if (group_name == "DisallowSyncCredentials") { | 545 } else if (group_name == "DisallowSyncCredentials") { |
546 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 546 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
547 } else { | 547 } else { |
548 // Allow by default. | 548 // Allow by default. |
549 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 549 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
550 } | 550 } |
551 } | 551 } |
OLD | NEW |