summaryrefslogtreecommitdiffstats
path: root/components/autofill/content/browser
diff options
context:
space:
mode:
authorramankk@chromium.org <ramankk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 21:14:51 +0000
committerramankk@chromium.org <ramankk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 21:14:51 +0000
commit87b15b04fb293be075e90d1e28dea6bc9b3fa2df (patch)
tree26b06a3a59a8efa5f905a71af5a18106925be1c4 /components/autofill/content/browser
parent156402abd7d3797ada080cd98f9bbd5969cb26cb (diff)
downloadchromium_src-87b15b04fb293be075e90d1e28dea6bc9b3fa2df.zip
chromium_src-87b15b04fb293be075e90d1e28dea6bc9b3fa2df.tar.gz
chromium_src-87b15b04fb293be075e90d1e28dea6bc9b3fa2df.tar.bz2
rAc: Get rid of dialog type in rAc, there is only one type left now.
BUG=276002 Review URL: https://chromiumcodereview.appspot.com/23537014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221271 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill/content/browser')
-rw-r--r--components/autofill/content/browser/risk/fingerprint.cc28
-rw-r--r--components/autofill/content/browser/risk/fingerprint.h1
-rw-r--r--components/autofill/content/browser/wallet/wallet_client.cc19
-rw-r--r--components/autofill/content/browser/wallet/wallet_client_delegate.h3
-rw-r--r--components/autofill/content/browser/wallet/wallet_client_unittest.cc24
5 files changed, 12 insertions, 63 deletions
diff --git a/components/autofill/content/browser/risk/fingerprint.cc b/components/autofill/content/browser/risk/fingerprint.cc
index 635224d..7383b55 100644
--- a/components/autofill/content/browser/risk/fingerprint.cc
+++ b/components/autofill/content/browser/risk/fingerprint.cc
@@ -68,20 +68,6 @@ std::string GetOperatingSystemVersion() {
base::SysInfo::OperatingSystemVersion();
}
-Fingerprint::MachineCharacteristics::BrowserFeature
- DialogTypeToBrowserFeature(DialogType dialog_type) {
- switch (dialog_type) {
- case DIALOG_TYPE_AUTOCHECKOUT:
- return Fingerprint::MachineCharacteristics::FEATURE_AUTOCHECKOUT;
-
- case DIALOG_TYPE_REQUEST_AUTOCOMPLETE:
- return Fingerprint::MachineCharacteristics::FEATURE_REQUEST_AUTOCOMPLETE;
- }
-
- NOTREACHED();
- return Fingerprint::MachineCharacteristics::FEATURE_UNKNOWN;
-}
-
// Adds the list of |fonts| to the |machine|.
void AddFontsToFingerprint(const base::ListValue& fonts,
Fingerprint::MachineCharacteristics* machine) {
@@ -201,7 +187,6 @@ class FingerprintDataLoader : public content::GpuDataManagerObserver {
const std::string& charset,
const std::string& accept_languages,
const base::Time& install_time,
- DialogType dialog_type,
const std::string& app_locale,
const base::Callback<void(scoped_ptr<Fingerprint>)>& callback);
@@ -250,7 +235,6 @@ class FingerprintDataLoader : public content::GpuDataManagerObserver {
const std::string charset_;
const std::string accept_languages_;
const base::Time install_time_;
- DialogType dialog_type_;
// Data that will be loaded asynchronously.
scoped_ptr<base::ListValue> fonts_;
@@ -276,7 +260,6 @@ FingerprintDataLoader::FingerprintDataLoader(
const std::string& charset,
const std::string& accept_languages,
const base::Time& install_time,
- DialogType dialog_type,
const std::string& app_locale,
const base::Callback<void(scoped_ptr<Fingerprint>)>& callback)
: gpu_data_manager_(content::GpuDataManager::GetInstance()),
@@ -289,7 +272,6 @@ FingerprintDataLoader::FingerprintDataLoader(
charset_(charset),
accept_languages_(accept_languages),
install_time_(install_time),
- dialog_type_(dialog_type),
waiting_on_plugins_(true),
callback_(callback) {
DCHECK(!install_time_.is_null());
@@ -404,7 +386,8 @@ void FingerprintDataLoader::FillFingerprint() {
machine->set_user_agent(content::GetUserAgent(GURL()));
machine->set_ram(base::SysInfo::AmountOfPhysicalMemory());
machine->set_browser_build(version_);
- machine->set_browser_feature(DialogTypeToBrowserFeature(dialog_type_));
+ machine->set_browser_feature(
+ Fingerprint::MachineCharacteristics::FEATURE_REQUEST_AUTOCOMPLETE);
AddFontsToFingerprint(*fonts_, machine);
AddPluginsToFingerprint(plugins_, machine);
AddAcceptLanguagesToFingerprint(accept_languages_, machine);
@@ -463,14 +446,13 @@ void GetFingerprintInternal(
const std::string& charset,
const std::string& accept_languages,
const base::Time& install_time,
- DialogType dialog_type,
const std::string& app_locale,
const base::Callback<void(scoped_ptr<Fingerprint>)>& callback) {
// Begin loading all of the data that we need to load asynchronously.
// This class is responsible for freeing its own memory.
new FingerprintDataLoader(obfuscated_gaia_id, window_bounds, content_bounds,
screen_info, version, charset, accept_languages,
- install_time, dialog_type, app_locale, callback);
+ install_time, app_locale, callback);
}
} // namespace internal
@@ -483,7 +465,6 @@ void GetFingerprint(
const std::string& charset,
const std::string& accept_languages,
const base::Time& install_time,
- DialogType dialog_type,
const std::string& app_locale,
const base::Callback<void(scoped_ptr<Fingerprint>)>& callback) {
gfx::Rect content_bounds;
@@ -497,8 +478,7 @@ void GetFingerprint(
internal::GetFingerprintInternal(
obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version,
- charset, accept_languages, install_time, dialog_type, app_locale,
- callback);
+ charset, accept_languages, install_time, app_locale, callback);
}
} // namespace risk
diff --git a/components/autofill/content/browser/risk/fingerprint.h b/components/autofill/content/browser/risk/fingerprint.h
index d66bde4..283e607 100644
--- a/components/autofill/content/browser/risk/fingerprint.h
+++ b/components/autofill/content/browser/risk/fingerprint.h
@@ -58,7 +58,6 @@ void GetFingerprint(
const std::string& charset,
const std::string& accept_languages,
const base::Time& install_time,
- DialogType dialog_type,
const std::string& app_locale,
const base::Callback<void(scoped_ptr<Fingerprint>)>& callback);
diff --git a/components/autofill/content/browser/wallet/wallet_client.cc b/components/autofill/content/browser/wallet/wallet_client.cc
index f664546..4756c21 100644
--- a/components/autofill/content/browser/wallet/wallet_client.cc
+++ b/components/autofill/content/browser/wallet/wallet_client.cc
@@ -52,17 +52,6 @@ const size_t kMaxBits = 56;
// accept.
const size_t kMinBits = 40;
-std::string DialogTypeToFeatureString(autofill::DialogType dialog_type) {
- switch (dialog_type) {
- case DIALOG_TYPE_REQUEST_AUTOCOMPLETE:
- return "REQUEST_AUTOCOMPLETE";
- case DIALOG_TYPE_AUTOCHECKOUT:
- return "AUTOCHECKOUT";
- }
- NOTREACHED();
- return "NOT_POSSIBLE";
-}
-
std::string RiskCapabilityToString(
WalletClient::RiskCapability risk_capability) {
switch (risk_capability) {
@@ -357,8 +346,7 @@ void WalletClient::GetFullWallet(const FullWalletRequest& full_wallet_request) {
full_wallet_request.source_url.GetWithEmptyPath().spec());
request_dict.SetString(kGoogleTransactionIdKey,
full_wallet_request.google_transaction_id);
- request_dict.SetString(kFeatureKey,
- DialogTypeToFeatureString(delegate_->GetDialogType()));
+ request_dict.SetString(kFeatureKey, "REQUEST_AUTOCOMPLETE");
scoped_ptr<base::ListValue> risk_capabilities_list(new base::ListValue());
for (std::vector<RiskCapability>::const_iterator it =
@@ -573,10 +561,8 @@ void WalletClient::MakeWalletRequest(const GURL& url,
request_->Start();
delegate_->GetMetricLogger().LogWalletErrorMetric(
- delegate_->GetDialogType(),
AutofillMetrics::WALLET_ERROR_BASELINE_ISSUED_REQUEST);
delegate_->GetMetricLogger().LogWalletRequiredActionMetric(
- delegate_->GetDialogType(),
AutofillMetrics::WALLET_REQUIRED_ACTION_BASELINE_ISSUED_REQUEST);
}
@@ -802,7 +788,7 @@ void WalletClient::HandleWalletError(WalletClient::ErrorType error_type) {
delegate_->OnWalletError(error_type);
delegate_->GetMetricLogger().LogWalletErrorMetric(
- delegate_->GetDialogType(), ErrorTypeToUmaMetric(error_type));
+ ErrorTypeToUmaMetric(error_type));
}
// Logs an UMA metric for each of the |required_actions|.
@@ -810,7 +796,6 @@ void WalletClient::LogRequiredActions(
const std::vector<RequiredAction>& required_actions) const {
for (size_t i = 0; i < required_actions.size(); ++i) {
delegate_->GetMetricLogger().LogWalletRequiredActionMetric(
- delegate_->GetDialogType(),
RequiredActionToUmaMetric(required_actions[i]));
}
}
diff --git a/components/autofill/content/browser/wallet/wallet_client_delegate.h b/components/autofill/content/browser/wallet/wallet_client_delegate.h
index 8de9504..8380fbf 100644
--- a/components/autofill/content/browser/wallet/wallet_client_delegate.h
+++ b/components/autofill/content/browser/wallet/wallet_client_delegate.h
@@ -33,9 +33,6 @@ class WalletClientDelegate {
// Wallet metrics.
virtual const AutofillMetrics& GetMetricLogger() const = 0;
- // Returns the dialog type that the delegate corresponds to.
- virtual DialogType GetDialogType() const = 0;
-
// Returns the serialized fingerprint data to be sent to the Risk server.
virtual std::string GetRiskData() const = 0;
diff --git a/components/autofill/content/browser/wallet/wallet_client_unittest.cc b/components/autofill/content/browser/wallet/wallet_client_unittest.cc
index 858b1d4..2ef1bb0 100644
--- a/components/autofill/content/browser/wallet/wallet_client_unittest.cc
+++ b/components/autofill/content/browser/wallet/wallet_client_unittest.cc
@@ -581,11 +581,9 @@ class MockAutofillMetrics : public AutofillMetrics {
MOCK_CONST_METHOD2(LogWalletApiCallDuration,
void(WalletApiCallMetric metric,
const base::TimeDelta& duration));
- MOCK_CONST_METHOD2(LogWalletErrorMetric,
- void(DialogType dialog_type, WalletErrorMetric metric));
- MOCK_CONST_METHOD2(LogWalletRequiredActionMetric,
- void(DialogType dialog_type,
- WalletRequiredActionMetric action));
+ MOCK_CONST_METHOD1(LogWalletErrorMetric, void(WalletErrorMetric metric));
+ MOCK_CONST_METHOD1(LogWalletRequiredActionMetric,
+ void(WalletRequiredActionMetric action));
private:
DISALLOW_COPY_AND_ASSIGN(MockAutofillMetrics);
};
@@ -602,10 +600,6 @@ class MockWalletClientDelegate : public WalletClientDelegate {
return metric_logger_;
}
- virtual DialogType GetDialogType() const OVERRIDE {
- return DIALOG_TYPE_REQUEST_AUTOCOMPLETE;
- }
-
virtual std::string GetRiskData() const OVERRIDE {
return "risky business";
}
@@ -630,25 +624,19 @@ class MockWalletClientDelegate : public WalletClientDelegate {
}
void ExpectWalletErrorMetric(AutofillMetrics::WalletErrorMetric metric) {
- EXPECT_CALL(
- metric_logger_,
- LogWalletErrorMetric(
- DIALOG_TYPE_REQUEST_AUTOCOMPLETE, metric)).Times(1);
+ EXPECT_CALL(metric_logger_, LogWalletErrorMetric(metric)).Times(1);
}
void ExpectWalletRequiredActionMetric(
AutofillMetrics::WalletRequiredActionMetric metric) {
- EXPECT_CALL(
- metric_logger_,
- LogWalletRequiredActionMetric(
- DIALOG_TYPE_REQUEST_AUTOCOMPLETE, metric)).Times(1);
+ EXPECT_CALL(metric_logger_,
+ LogWalletRequiredActionMetric(metric)).Times(1);
}
void ExpectBaselineMetrics() {
EXPECT_CALL(
metric_logger_,
LogWalletErrorMetric(
- DIALOG_TYPE_REQUEST_AUTOCOMPLETE,
AutofillMetrics::WALLET_ERROR_BASELINE_ISSUED_REQUEST))
.Times(1);
ExpectWalletRequiredActionMetric(