#include "chrome/browser/ui/views/compose/compose_dialog_view.h"
#include <vector>
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
#include "components/compose/core/browser/config.h"
#include "components/renderer_context_menu/context_menu_delegate.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/view_class_properties.h"
namespace {
gfx::Rect FallbackAtBottomShiftUpToPermanentPosition(
gfx::Rect best_location,
const gfx::Rect& screen_work_area,
const gfx::Size& widget_size) { … }
gfx::Rect FallbackAtBottomShiftMinimumForVisibility(gfx::Rect best_location) { … }
gfx::Rect FallbackCenterOnFormFieldStrategy(const gfx::Rect& screen_work_are,
const gfx::Size& widget_size,
const gfx::Rect& anchor_rect) { … }
}
DEFINE_ELEMENT_IDENTIFIER_VALUE(kComposeWebviewElementId);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(ComposeDialogView, kComposeDialogId);
gfx::Rect ComposeDialogView::CalculateBubbleBounds(
gfx::Rect screen_work_area,
gfx::Size widget_size,
gfx::Rect anchor_bounds,
std::optional<gfx::Rect> parent_bounds) { … }
ComposeDialogView::~ComposeDialogView() = default;
ComposeDialogView::ComposeDialogView(
View* anchor_view,
std::unique_ptr<WebUIContentsWrapperT<ComposeUntrustedUI>> bubble_wrapper,
const gfx::Rect& anchor_bounds,
views::BubbleBorder::Arrow anchor_position)
: … { … }
void ComposeDialogView::OnBeforeBubbleWidgetInit(
views::Widget::InitParams* params,
views::Widget* widget) const { … }
gfx::Rect ComposeDialogView::GetBubbleBounds() { … }
bool ComposeDialogView::HandleContextMenu(
content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params) { … }
base::WeakPtr<ComposeDialogView> ComposeDialogView::GetWeakPtr() { … }
BEGIN_METADATA(…)