// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_SUPERVISED_USER_PARENT_PERMISSION_DIALOG_H_ #define CHROME_BROWSER_UI_SUPERVISED_USER_PARENT_PERMISSION_DIALOG_H_ #include <stddef.h> #include <string> #include "base/functional/callback_forward.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h" #include "ui/base/interaction/element_identifier.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/native_widget_types.h" class Profile; namespace extensions { class Extension; } // This file provides an API that will prompt a child user's parent(s) for their // permission for action. The parent(s) can approve the action by entering // their Google password, which is then verified using the Google // Reauthentication API's child to parent delegation mode. The prompt can only // be shown if the user is a child. Otherwise, the prompt will fail. // Clients should provide a ParentPermissionDialog::DoneCallback to // receive the results of the dialog. // Example Usage: // ParentPermissionDialog::DoneCallback callback = base::BindOnce( // &MyClass::OnParentPermissionDialogDone, // weak_ptr_factory_.GetWeakPtr())) // gfx::ImageSkia icon = LoadMyIcon(); // // std::unique_ptr<ParentPermissionDialog> dialog = // CreateParentPermissionDialog(profile, window, icon, message, done_callback); // // dialog->ShowDialog(); // // MyClass::ParentPermissionDialogDone(ParentPermissionDialog::Result result) { // switch (result) { // ... // } // } // API for the Dialog. class ParentPermissionDialog { … }; #endif // CHROME_BROWSER_UI_SUPERVISED_USER_PARENT_PERMISSION_DIALOG_H_