chromium/components/optimization_guide/core/model_execution/model_execution_features_controller.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/optimization_guide/core/model_execution/model_execution_features_controller.h"

#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "components/component_updater/pref_names.h"
#include "components/optimization_guide/core/feature_registry/mqls_feature_registry.h"
#include "components/optimization_guide/core/feature_registry/settings_ui_registry.h"
#include "components/optimization_guide/core/model_execution/feature_keys.h"
#include "components/optimization_guide/core/model_execution/model_execution_features.h"
#include "components/optimization_guide/core/model_execution/model_execution_prefs.h"
#include "components/optimization_guide/core/optimization_guide_prefs.h"
#include "components/optimization_guide/core/optimization_guide_switches.h"
#include "components/optimization_guide/core/optimization_guide_util.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "third_party/tflite/buildflags.h"

namespace optimization_guide {

namespace {

// Util class for recording the construction and validation of Settings
// Visibility histogram.
class ScopedSettingsVisibilityResultHistogramRecorder {};

enum class FeatureCurrentlyEnabledResult {};

// Util class for recording the construction and validation of Settings
// Visibility histogram.
class ScopedFeatureCurrentlyEnabledHistogramRecorder {};

// Returns whether the model execution capability is enabled. Use this whenever
// the `AccountInfo` is available which has more recent data, instead of
// querying via the `IdentityManager` that could be having stale information.
bool CanUseModelExecutionFeaturesFromAccountInfo(
    const AccountInfo account_info) {}

bool CanUseModelExecutionFeatures(signin::IdentityManager* identity_manager) {}

}  // namespace

ModelExecutionFeaturesController::ModelExecutionFeaturesController(
    PrefService* browser_context_profile_service,
    signin::IdentityManager* identity_manager,
    PrefService* local_state,
    DogfoodStatus dogfood_status)
    :{}

ModelExecutionFeaturesController::~ModelExecutionFeaturesController() = default;

bool ModelExecutionFeaturesController::ShouldFeatureBeCurrentlyEnabledForUser(
    UserVisibleFeatureKey feature) const {}

bool ModelExecutionFeaturesController::
    ShouldFeatureBeCurrentlyAllowedForLogging(
        const MqlsFeatureMetadata* metadata) const {}

prefs::FeatureOptInState ModelExecutionFeaturesController::GetPrefState(
    UserVisibleFeatureKey feature) const {}

ModelExecutionFeaturesController::UserValidityResult
ModelExecutionFeaturesController::GetCurrentUserValidityResult(
    UserVisibleFeatureKey feature) const {}

ModelExecutionFeaturesController::SettingsVisibilityResult
ModelExecutionFeaturesController::ShouldHideHistorySearch() const {}

bool ModelExecutionFeaturesController::IsSettingVisible(
    UserVisibleFeatureKey feature) const {}

void ModelExecutionFeaturesController::AddObserver(
    SettingsEnabledObserver* observer) {}

void ModelExecutionFeaturesController::RemoveObserver(
    SettingsEnabledObserver* observer) {}

void ModelExecutionFeaturesController::OnIdentityManagerShutdown(
    signin::IdentityManager* identity_manager) {}

void ModelExecutionFeaturesController::OnFeatureSettingPrefChanged(
    UserVisibleFeatureKey feature) {}

void ModelExecutionFeaturesController::OnFeatureEnterprisePolicyPrefChanged(
    UserVisibleFeatureKey feature) {}

void ModelExecutionFeaturesController::InitializeFeatureSettings() {}

void ModelExecutionFeaturesController::StartObservingAccountChanges() {}

void ModelExecutionFeaturesController::OnPrimaryAccountChanged(
    const signin::PrimaryAccountChangeEvent& event_details) {}

void ModelExecutionFeaturesController::OnExtendedAccountInfoUpdated(
    const AccountInfo& info) {}

void ModelExecutionFeaturesController::ResetInvalidFeaturePrefs() {}

void ModelExecutionFeaturesController::OnMainToggleSettingStatePrefChanged() {}

void ModelExecutionFeaturesController::InitializePrefListener() {}

}  // namespace optimization_guide