| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 PasswordManagerInternalsService* service = | 133 PasswordManagerInternalsService* service = |
| 134 PasswordManagerInternalsServiceFactory::GetForBrowserContext(profile_); | 134 PasswordManagerInternalsServiceFactory::GetForBrowserContext(profile_); |
| 135 if (service) | 135 if (service) |
| 136 service->UnregisterClient(this); | 136 service->UnregisterClient(this); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool ChromePasswordManagerClient::IsAutomaticPasswordSavingEnabled() const { | 139 bool ChromePasswordManagerClient::IsAutomaticPasswordSavingEnabled() const { |
| 140 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 140 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 141 password_manager::switches::kEnableAutomaticPasswordSaving) && | 141 password_manager::switches::kEnableAutomaticPasswordSaving) && |
| 142 chrome::VersionInfo::GetChannel() == | 142 chrome::VersionInfo::GetChannel() == |
| 143 chrome::VersionInfo::CHANNEL_UNKNOWN; | 143 version_info::Channel::UNKNOWN; |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool ChromePasswordManagerClient::IsPasswordManagementEnabledForCurrentPage() | 146 bool ChromePasswordManagerClient::IsPasswordManagementEnabledForCurrentPage() |
| 147 const { | 147 const { |
| 148 DCHECK(web_contents()); | 148 DCHECK(web_contents()); |
| 149 content::NavigationEntry* entry = | 149 content::NavigationEntry* entry = |
| 150 web_contents()->GetController().GetLastCommittedEntry(); | 150 web_contents()->GetController().GetLastCommittedEntry(); |
| 151 bool is_enabled = false; | 151 bool is_enabled = false; |
| 152 if (!entry) { | 152 if (!entry) { |
| 153 // TODO(gcasto): Determine if fix for crbug.com/388246 is relevant here. | 153 // TODO(gcasto): Determine if fix for crbug.com/388246 is relevant here. |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 584 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
| 585 } else { | 585 } else { |
| 586 // Allow by default. | 586 // Allow by default. |
| 587 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 587 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
| 588 } | 588 } |
| 589 } | 589 } |
| 590 | 590 |
| 591 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { | 591 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { |
| 592 return web_contents()->GetVisibleURL(); | 592 return web_contents()->GetVisibleURL(); |
| 593 } | 593 } |
| OLD | NEW |