chromium/components/segmentation_platform/embedder/default_model/password_manager_user_segment.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/segmentation_platform/embedder/default_model/password_manager_user_segment.h"

#include <cstdint>
#include <memory>

#include "base/task/sequenced_task_runner.h"
#include "components/segmentation_platform/internal/metadata/metadata_writer.h"
#include "components/segmentation_platform/public/config.h"
#include "components/segmentation_platform/public/constants.h"
#include "components/segmentation_platform/public/features.h"
#include "components/segmentation_platform/public/proto/aggregation.pb.h"
#include "components/segmentation_platform/public/proto/model_metadata.pb.h"

namespace segmentation_platform {

namespace {
SegmentId;

// Default parameters for password manager user model.
constexpr SegmentId kPasswordManagerUserSegmentId =;
// Store 28 buckets of input data (28 days).
constexpr int64_t kPasswordManagerUserSignalStorageLength =;
// Wait until we have 7 days of data.
constexpr int64_t kPasswordManagerUserMinSignalCollectionLength =;
// Refresh the result every 7 days.
constexpr int64_t kPasswordManagerUserResultTTLDays =;

// Threshold for password count. Users with more than 6 stored passwords are
// considered password manager users.
constexpr int64_t kStoredPasswordCountThreshold =;

// InputFeatures.

// Enum values for PasswordManager.ManagePasswordsReferrer.
constexpr std::array<int32_t, 1> kPasswordManagerReferrerEnumValues{};

// Default value for
// PasswordManager.ProfileStore.TotalAccountsHiRes3.WithScheme.Https when no
// values have been recorded.
constexpr std::array<float, 1> kPasswordCountDefaultValue{};

// Enum values for PasswordManager.FillingAssistance, these buckets were
// selected based on the calculated histogram
// Transactions.Vitals.AssistedLogins.
constexpr std::array<int32_t, 3> kFillingAssistanceEnumValues{};

// Enum values for PasswordManager.NewlySavedPasswordIsGenerated.
constexpr std::array<int32_t, 1> kSavedPasswordTypeEnumValues{};

// Positive enum value for PasswordManager.SaveUIDismissalReason. This is
// separate from the negative enum values so we get separate totals and we can
// compare them.
constexpr std::array<int32_t, 1> kSaveUiPositiveEnumValues{};

// Negative enum values for PasswordManager.SaveUIDismissalReason.
constexpr std::array<int32_t, 3> kSaveUiNegativeEnumValues{};

// Enum value for IOS.CredentialExtension.IsEnabled.Startup. (iOS only).
constexpr std::array<int32_t, 1> kIOSCredentialExtensionEnabledValue{};

const char kPasswordManagerUserNegativeLabel[] =;

// Set UMA metrics to use as input.
constexpr std::array<MetadataWriter::UMAFeature, 7>
    kPasswordManagerUserUMAFeatures =;
}  // namespace

// static
std::unique_ptr<Config> PasswordManagerUserModel::GetConfig() {}

PasswordManagerUserModel::PasswordManagerUserModel()
    :{}

std::unique_ptr<DefaultModelProvider::ModelConfig>
PasswordManagerUserModel::GetModelConfig() {}

void PasswordManagerUserModel::ExecuteModelWithInput(
    const ModelProvider::Request& inputs,
    ExecutionCallback callback) {}

}  // namespace segmentation_platform