chromium/chrome/browser/ui/views/permissions/embedded_permission_prompt_content_scrim_view.h

// 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.

#ifndef CHROME_BROWSER_UI_VIEWS_PERMISSIONS_EMBEDDED_PERMISSION_PROMPT_CONTENT_SCRIM_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_PERMISSIONS_EMBEDDED_PERMISSION_PROMPT_CONTENT_SCRIM_VIEW_H_

#include <memory>

#include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h"
#include "chrome/browser/ui/views/permissions/embedded_permission_prompt_view_delegate.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/events/event.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"

// The view class, which is owned by the `EmbeddedPermissionPrompt`, applies a
// scrim to the contents view on the root window while the permission prompt is
// presenting. This view will always float above and cover entirely the root
// window's content view, the intention is to obscure the content UI and prevent
// web-content interaction while the user is interacting with the permission
// prompt.
// The `EmbeddedPermissionPrompt` is responsible for managing the lifetime of
// the scrim view and the in-progress `EmbeddedPermissionPromptBaseView`. When
// the prompt view is destroyed, the scrim is automatically removed. Clicking on
// this scrim view will destroy both the scrim view and the in-progress
// `EmbeddedPermissionPromptBaseView`.
class EmbeddedPermissionPromptContentScrimView : public views::View,
                                                 public views::WidgetObserver {};

#endif  // CHROME_BROWSER_UI_VIEWS_PERMISSIONS_EMBEDDED_PERMISSION_PROMPT_CONTENT_SCRIM_VIEW_H_