chromium/chrome/browser/ui/tabs/tab_group_deletion_dialog_controller.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 "chrome/browser/ui/tabs/tab_group_deletion_dialog_controller.h"

#include <memory>
#include <string>

#include "base/functional/callback.h"
#include "base/i18n/message_formatter.h"
#include "base/no_destructor.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_pref_names.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/dialog_model.h"

namespace tab_groups {
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE();
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE();
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE();

namespace {
// The text that shows on the checkbox.
constexpr int kDontAskId =;

// Body text for all delete actions.
constexpr int kDeleteBodySyncedId =;
constexpr int kDeleteBodyNotSyncedId =;

// For deletion, the text that shows on the dialog
constexpr int kDeleteTitleId =;
constexpr int kDeleteOkTextId =;

// For ungrouping, the text that shows on the dialog.
constexpr int kUngroupTitleId =;
constexpr int kUngroupBodySyncedId =;
constexpr int kUngroupBodyNotSyncedId =;
constexpr int kUngroupOkTextId =;

// For closing the last tab, the text that shows on the dialog.
constexpr int kCloseTabAndDeleteTitleId =;

// For removing the last tab, the text that shows on the dialog.
constexpr int kRemoveTabAndDeleteTitleId =;

struct DialogText {};

// Returns the list of strings that are needed for a given dialog type.
DialogText GetDialogText(Profile* profile,
                         DeletionDialogController::DialogType type,
                         int tab_count,
                         int group_count) {}

// Returns the the value from the settings pref for a given dialog type.
bool IsDialogSkippedByUserSettings(Profile* profile,
                                   DeletionDialogController::DialogType type) {}

void SetSkipDialogForType(Profile* profile,
                          DeletionDialogController::DialogType type,
                          bool new_value) {}

}  // anonymous namespace

DeletionDialogController::DialogState::DialogState(
    DialogType type_,
    ui::DialogModel* dialog_model_,
    base::OnceCallback<void()> on_ok_button_pressed_,
    base::OnceCallback<void()> on_cancel_button_pressed_)
    :{}

DeletionDialogController::DialogState::~DialogState() = default;

DeletionDialogController::DeletionDialogController(Browser* browser)
    :{}

DeletionDialogController::~DeletionDialogController() = default;

bool DeletionDialogController::CanShowDialog() {}

bool DeletionDialogController::IsShowingDialog() {}

bool DeletionDialogController::MaybeShowDialog(
    DialogType type,
    base::OnceCallback<void()> on_ok_callback,
    int tab_count,
    int group_count) {}

void DeletionDialogController::SetPrefsPreventShowingDialogForTesting(
    bool should_prevent_dialog) {}

void DeletionDialogController::OnDialogOk() {}

void DeletionDialogController::OnDialogCancel() {}

std::unique_ptr<ui::DialogModel> DeletionDialogController::BuildDialogModel(
    DialogType type,
    int tab_count,
    int group_count) {}

}  // namespace tab_groups