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

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 789613004: Decision whenever "Allow to collect URL?" bubble should be shown or not (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes which belong to this CL. Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/chrome_password_manager_client.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index b98f9e7d496500ebd6343c48ccf5c09388142be0..e1bcf788520350c2793550f415582e50d74c1996 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -10,6 +10,7 @@
#include "base/metrics/histogram.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/password_manager/password_manager_util.h"
#include "chrome/browser/password_manager/password_store_factory.h"
@@ -28,6 +29,7 @@
#include "components/autofill/content/common/autofill_messages.h"
#include "components/autofill/core/browser/password_generator.h"
#include "components/autofill/core/common/password_form.h"
+#include "components/metrics/metrics_service.h"
#include "components/password_manager/content/browser/content_password_manager_driver.h"
#include "components/password_manager/content/browser/password_manager_internals_service_factory.h"
#include "components/password_manager/content/common/credential_manager_messages.h"
@@ -153,9 +155,15 @@ bool ChromePasswordManagerClient::IsPasswordManagerEnabledForCurrentPage()
}
bool ChromePasswordManagerClient::ShouldAskUserToSubmitURL(const GURL& url) {
- return url.is_valid() && !url.is_empty() && url.has_host() &&
- password_manager::urls_collection_experiment::ShouldShowBubble(
- GetPrefs());
+ if (url.is_valid() && !url.is_empty() && url.has_host()) {
+ std::stringstream profile_uuid_stream;
vabr (Chromium) 2014/12/10 18:19:54 The style guide forbids streams (except for loggin
melandory 2014/12/11 08:37:38 Done.
+ profile_uuid_stream << profile_->GetProfileName();
+ profile_uuid_stream
+ << g_browser_process->metrics_service()->GetInstallDate();
+ return password_manager::urls_collection_experiment::ShouldShowBubble(
+ GetPrefs(), profile_uuid_stream.str());
+ }
+ return false;
}
bool ChromePasswordManagerClient::ShouldFilterAutofillResult(

Powered by Google App Engine
This is Rietveld 408576698