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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 if (command_line->HasSwitch(switches::kEnableSavePasswordBubble)) | 526 if (command_line->HasSwitch(switches::kEnableSavePasswordBubble)) |
527 return true; | 527 return true; |
528 | 528 |
529 std::string group_name = | 529 std::string group_name = |
530 base::FieldTrialList::FindFullName("PasswordManagerUI"); | 530 base::FieldTrialList::FindFullName("PasswordManagerUI"); |
531 | 531 |
532 // The bubble should be the default case that runs on the bots. | 532 // The bubble should be the default case that runs on the bots. |
533 return group_name != "Infobar"; | 533 return group_name != "Infobar"; |
534 } | 534 } |
535 | 535 |
| 536 bool ChromePasswordManagerClient::IsPasswordUpdateUIEnabled() const { |
| 537 if (!ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled()) { |
| 538 // Currently Password update UI is implemented only for Bubble UI. |
| 539 return false; |
| 540 } |
| 541 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 542 return command_line->HasSwitch( |
| 543 password_manager::switches::kEnablePasswordChangeSupport); |
| 544 } |
| 545 |
536 bool ChromePasswordManagerClient::EnabledForSyncSignin() { | 546 bool ChromePasswordManagerClient::EnabledForSyncSignin() { |
537 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 547 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
538 if (command_line->HasSwitch( | 548 if (command_line->HasSwitch( |
539 password_manager::switches::kDisableManagerForSyncSignin)) | 549 password_manager::switches::kDisableManagerForSyncSignin)) |
540 return false; | 550 return false; |
541 | 551 |
542 if (command_line->HasSwitch( | 552 if (command_line->HasSwitch( |
543 password_manager::switches::kEnableManagerForSyncSignin)) | 553 password_manager::switches::kEnableManagerForSyncSignin)) |
544 return true; | 554 return true; |
545 | 555 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 587 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
578 } else { | 588 } else { |
579 // Allow by default. | 589 // Allow by default. |
580 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 590 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
581 } | 591 } |
582 } | 592 } |
583 | 593 |
584 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { | 594 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { |
585 return web_contents()->GetVisibleURL(); | 595 return web_contents()->GetVisibleURL(); |
586 } | 596 } |
OLD | NEW |