chromium/components/enterprise/data_controls/core/browser/data_controls_dialog_factory.cc

// Copyright 2024 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/enterprise/data_controls/core/browser/data_controls_dialog_factory.h"

#include <map>

#include "base/memory/singleton.h"

namespace data_controls {

namespace {

// Helper that keeps track of dialogs currently showing for given
// WebContents-type pair.  These are used to determine if a call to
// `DataControlsDialog::Show` is redundant or not. Keyed with `void*` instead of
// `content::WebContents*` to avoid accidental bugs from dereferencing that
// pointer.
std::map<std::pair<void*, DataControlsDialog::Type>, DataControlsDialog*>&
CurrentDialogsStorage() {}

// Returns null if no dialog is currently shown on `web_contents` for `type`.
DataControlsDialog* GetCurrentDialog(content::WebContents* web_contents,
                                     DataControlsDialog::Type type) {}

}  // namespace

void DataControlsDialogFactory::ShowDialogIfNeeded(
    content::WebContents* web_contents,
    DataControlsDialog::Type type,
    base::OnceCallback<void(bool bypassed)> callback) {}

}  // namespace data_controls