Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 1668523002: [Password Manager] Switch password manager code to use the Feature framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/command_line.h"
13 #include "base/memory/singleton.h" 12 #include "base/memory/singleton.h"
14 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
15 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
16 #include "build/build_config.h" 15 #include "build/build_config.h"
17 #include "chrome/browser/browsing_data/browsing_data_helper.h" 16 #include "chrome/browser/browsing_data/browsing_data_helper.h"
18 #include "chrome/browser/password_manager/password_store_factory.h" 17 #include "chrome/browser/password_manager/password_store_factory.h"
19 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/signin/signin_manager_factory.h" 19 #include "chrome/browser/signin/signin_manager_factory.h"
21 #include "chrome/browser/sync/profile_sync_service_factory.h" 20 #include "chrome/browser/sync/profile_sync_service_factory.h"
22 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h " 21 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h "
(...skipping 16 matching lines...) Expand all
39 #include "components/password_manager/core/browser/log_receiver.h" 38 #include "components/password_manager/core/browser/log_receiver.h"
40 #include "components/password_manager/core/browser/password_bubble_experiment.h" 39 #include "components/password_manager/core/browser/password_bubble_experiment.h"
41 #include "components/password_manager/core/browser/password_form_manager.h" 40 #include "components/password_manager/core/browser/password_form_manager.h"
42 #include "components/password_manager/core/browser/password_manager_internals_se rvice.h" 41 #include "components/password_manager/core/browser/password_manager_internals_se rvice.h"
43 #include "components/password_manager/core/browser/password_manager_metrics_util .h" 42 #include "components/password_manager/core/browser/password_manager_metrics_util .h"
44 #include "components/password_manager/core/browser/password_manager_settings_mig ration_experiment.h" 43 #include "components/password_manager/core/browser/password_manager_settings_mig ration_experiment.h"
45 #include "components/password_manager/core/browser/password_manager_util.h" 44 #include "components/password_manager/core/browser/password_manager_util.h"
46 #include "components/password_manager/core/common/credential_manager_types.h" 45 #include "components/password_manager/core/common/credential_manager_types.h"
47 #include "components/password_manager/core/common/password_manager_features.h" 46 #include "components/password_manager/core/common/password_manager_features.h"
48 #include "components/password_manager/core/common/password_manager_pref_names.h" 47 #include "components/password_manager/core/common/password_manager_pref_names.h"
49 #include "components/password_manager/core/common/password_manager_switches.h"
50 #include "components/password_manager/sync/browser/password_sync_util.h" 48 #include "components/password_manager/sync/browser/password_sync_util.h"
51 #include "components/prefs/pref_service.h" 49 #include "components/prefs/pref_service.h"
52 #include "components/signin/core/browser/signin_manager.h" 50 #include "components/signin/core/browser/signin_manager.h"
53 #include "components/version_info/version_info.h" 51 #include "components/version_info/version_info.h"
54 #include "content/public/browser/navigation_entry.h" 52 #include "content/public/browser/navigation_entry.h"
55 #include "content/public/browser/render_view_host.h" 53 #include "content/public/browser/render_view_host.h"
56 #include "content/public/browser/web_contents.h" 54 #include "content/public/browser/web_contents.h"
57 #include "google_apis/gaia/gaia_urls.h" 55 #include "google_apis/gaia/gaia_urls.h"
58 #include "net/base/url_util.h" 56 #include "net/base/url_util.h"
59 #include "third_party/re2/src/re2/re2.h" 57 #include "third_party/re2/src/re2/re2.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 return true; 555 return true;
558 #endif 556 #endif
559 } 557 }
560 558
561 bool ChromePasswordManagerClient::IsUpdatePasswordUIEnabled() const { 559 bool ChromePasswordManagerClient::IsUpdatePasswordUIEnabled() const {
562 // Currently Password update UI is implemented only for Bubble UI. 560 // Currently Password update UI is implemented only for Bubble UI.
563 return IsTheHotNewBubbleUIEnabled(); 561 return IsTheHotNewBubbleUIEnabled();
564 } 562 }
565 563
566 bool ChromePasswordManagerClient::EnabledForSyncSignin() { 564 bool ChromePasswordManagerClient::EnabledForSyncSignin() {
567 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 565 if (base::FeatureList::IsEnabled(
568 if (command_line->HasSwitch( 566 password_manager::features::kDisableManagerForSyncSignin)) {
569 password_manager::switches::kDisableManagerForSyncSignin))
570 return false; 567 return false;
568 }
571 569
572 if (command_line->HasSwitch( 570 if (base::FeatureList::IsEnabled(
573 password_manager::switches::kEnableManagerForSyncSignin)) 571 password_manager::features::kEnableManagerForSyncSignin)) {
574 return true; 572 return true;
573 }
575 574
576 // Default is enabled. 575 // Default is enabled.
577 std::string group_name = 576 std::string group_name =
578 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); 577 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin");
579 return group_name != "Disabled"; 578 return group_name != "Disabled";
580 } 579 }
581 580
582 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { 581 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const {
583 return web_contents()->GetVisibleURL(); 582 return web_contents()->GetVisibleURL();
584 } 583 }
(...skipping 10 matching lines...) Expand all
595 594
596 const password_manager::CredentialsFilter* 595 const password_manager::CredentialsFilter*
597 ChromePasswordManagerClient::GetStoreResultFilter() const { 596 ChromePasswordManagerClient::GetStoreResultFilter() const {
598 return &credentials_filter_; 597 return &credentials_filter_;
599 } 598 }
600 599
601 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() 600 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager()
602 const { 601 const {
603 return log_manager_.get(); 602 return log_manager_.get();
604 } 603 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698