Commit 423d45cb authored by estade's avatar estade Committed by Commit bot

Actually disable Wallet card saving on Linux.

This isn't the ideal solution because I'd like to be able to pass a gyp-time flag to re-enable it (for testing purposes), but it's the smallest patch for merging.

BUG=468045

Review URL: https://codereview.chromium.org/1099993002

Cr-Commit-Position: refs/heads/master@{#326296}
parent f6c09395
......@@ -328,7 +328,8 @@ void CardUnmaskPromptViews::AnimationProgressed(
const gfx::Animation* animation) {
uint8_t alpha = static_cast<uint8_t>(animation->CurrentValueBetween(0, 255));
progress_overlay_->SetAlpha(alpha);
storage_row_->SetAlpha(255 - alpha);
if (storage_row_)
storage_row_->SetAlpha(255 - alpha);
}
void CardUnmaskPromptViews::InitIfNecessary() {
......
......@@ -203,12 +203,10 @@
'autofill/core/browser/webdata/autofill_webdata_service_observer.h',
],
'conditions': [
['desktop_linux==1', {
['desktop_linux != 1', {
# Controls whether Wallet cards can be saved to the local instance of
# chrome.
'defines': [ 'ENABLE_SAVE_WALLET_CARDS_LOCALLY=0' ],
}, {
'defines': [ 'ENABLE_SAVE_WALLET_CARDS_LOCALLY=1' ],
'defines': [ 'ENABLE_SAVE_WALLET_CARDS_LOCALLY' ],
}],
],
......
......@@ -120,10 +120,8 @@ static_library("browser") {
]
# Controls whether Wallet cards can be saved to the local instance of chrome.
if (is_desktop_linux) {
defines = [ "ENABLE_SAVE_WALLET_CARDS_LOCALLY=0" ]
} else {
defines = [ "ENABLE_SAVE_WALLET_CARDS_LOCALLY=1" ]
if (!is_desktop_linux) {
defines = [ "ENABLE_SAVE_WALLET_CARDS_LOCALLY" ]
}
deps = [
......
......@@ -15,6 +15,7 @@
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/form_structure.h"
......@@ -494,6 +495,16 @@ TEST_F(PersonalDataManagerTest, UpdateServerCreditCards) {
base::MessageLoop::current()->Run();
ASSERT_EQ(3U, personal_data_->GetCreditCards().size());
if (!OfferStoreUnmaskedCards()) {
for (CreditCard* card : personal_data_->GetCreditCards()) {
EXPECT_EQ(CreditCard::MASKED_SERVER_CARD, card->record_type());
}
// The rest of this test doesn't work if we're force-masking all unmasked
// cards.
return;
}
// The GUIDs will be different, so just compare the data.
for (size_t i = 0; i < 3; ++i)
EXPECT_EQ(0, server_cards[i].Compare(*personal_data_->GetCreditCards()[i]));
......@@ -3143,6 +3154,16 @@ TEST_F(PersonalDataManagerTest, UpdateServerCreditCardUsageStats) {
base::MessageLoop::current()->Run();
ASSERT_EQ(3U, personal_data_->GetCreditCards().size());
if (!OfferStoreUnmaskedCards()) {
for (CreditCard* card : personal_data_->GetCreditCards()) {
EXPECT_EQ(CreditCard::MASKED_SERVER_CARD, card->record_type());
}
// The rest of this test doesn't work if we're force-masking all unmasked
// cards.
return;
}
// The GUIDs will be different, so just compare the data.
for (size_t i = 0; i < 3; ++i)
EXPECT_EQ(0, server_cards[i].Compare(*personal_data_->GetCreditCards()[i]));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment