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/ui/webui/password_manager_internals/password_manager_in
ternals_ui.h" | 5 #include "chrome/browser/ui/webui/password_manager_internals/password_manager_in
ternals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 // Reset the first run experience for auto sign-in if the user opened | 82 // Reset the first run experience for auto sign-in if the user opened |
83 // chrome://password-manager-internals/?reset_fre . | 83 // chrome://password-manager-internals/?reset_fre . |
84 // TODO(crbug.com/599454) This may be removed in M53, when the credential | 84 // TODO(crbug.com/599454) This may be removed in M53, when the credential |
85 // manager API has been launched to stable. | 85 // manager API has been launched to stable. |
86 GURL url = web_ui()->GetWebContents()->GetVisibleURL(); | 86 GURL url = web_ui()->GetWebContents()->GetVisibleURL(); |
87 if (url.is_valid() && url.has_query()) { | 87 if (url.is_valid() && url.has_query()) { |
88 std::vector<std::string> query_parameters = base::SplitString( | 88 std::vector<std::string> query_parameters = base::SplitString( |
89 url.query(), "&", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); | 89 url.query(), "&", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); |
90 if (ContainsValue(query_parameters, "reset_fre")) | 90 if (base::ContainsValue(query_parameters, "reset_fre")) |
91 ResetAutoSignInFirstRunExperience(); | 91 ResetAutoSignInFirstRunExperience(); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 void PasswordManagerInternalsUI::LogSavePasswordProgress( | 95 void PasswordManagerInternalsUI::LogSavePasswordProgress( |
96 const std::string& text) { | 96 const std::string& text) { |
97 if (!registered_with_logging_service_ || text.empty()) | 97 if (!registered_with_logging_service_ || text.empty()) |
98 return; | 98 return; |
99 std::string no_quotes(text); | 99 std::string no_quotes(text); |
100 std::replace(no_quotes.begin(), no_quotes.end(), '"', ' '); | 100 std::replace(no_quotes.begin(), no_quotes.end(), '"', ' '); |
(...skipping 19 matching lines...) Expand all Loading... |
120 profile->GetPrefs()->SetBoolean( | 120 profile->GetPrefs()->SetBoolean( |
121 password_manager::prefs::kWasAutoSignInFirstRunExperienceShown, false); | 121 password_manager::prefs::kWasAutoSignInFirstRunExperienceShown, false); |
122 | 122 |
123 PasswordManagerInternalsService* service = | 123 PasswordManagerInternalsService* service = |
124 PasswordManagerInternalsServiceFactory::GetForBrowserContext( | 124 PasswordManagerInternalsServiceFactory::GetForBrowserContext( |
125 Profile::FromWebUI(web_ui())); | 125 Profile::FromWebUI(web_ui())); |
126 if (service) | 126 if (service) |
127 service->ProcessLog("Reset auto sign-in first run experience: yes"); | 127 service->ProcessLog("Reset auto sign-in first run experience: yes"); |
128 } | 128 } |
129 } | 129 } |
OLD | NEW |