#include "chrome/browser/ui/views/frame/browser_root_view.h"
#include <cmath>
#include <iterator>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/containers/adapters.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/user_metrics.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_strip_user_gesture_details.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/frame/browser_frame.h"
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/common/chrome_features.h"
#include "components/omnibox/browser/autocomplete_classifier.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/webplugininfo.h"
#include "net/base/filename_util.h"
#include "net/base/mime_util.h"
#include "ppapi/buildflags/buildflags.h"
#include "third_party/blink/public/common/mime_util/mime_util.h"
#include "third_party/metrics_proto/omnibox_event.pb.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/drop_target_event.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/hit_test.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_provider.h"
#include "ui/compositor/layer_tree_owner.h"
#include "ui/compositor/paint_recorder.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/views/view.h"
#include "url/url_constants.h"
#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/browser/plugin_service.h"
#endif
namespace {
DragOperation;
int gDropInfoSequence = …;
std::vector<std::string> GetURLMimeTypes(const std::vector<GURL>& urls) { … }
void FilterURLsForDropability(
const std::vector<GURL>& urls,
content::BrowserContext* browser_context,
base::OnceCallback<void(std::vector<GURL> urls)> callback,
const std::vector<std::string>& mime_types) { … }
std::vector<GURL> GetURLsForDrop(const ui::DropTargetEvent& event) { … }
DragOperation GetDropEffect(const ui::DropTargetEvent& event) { … }
}
BrowserRootView::DropInfo::DropInfo() = default;
BrowserRootView::DropInfo::~DropInfo() { … }
BrowserRootView::BrowserRootView(BrowserView* browser_view,
views::Widget* widget)
: … { … }
BrowserRootView::~BrowserRootView() { … }
bool BrowserRootView::GetDropFormats(
int* formats,
std::set<ui::ClipboardFormatType>* format_types) { … }
bool BrowserRootView::AreDropTypesRequired() { … }
bool BrowserRootView::CanDrop(const ui::OSExchangeData& data) { … }
void BrowserRootView::OnDragEntered(const ui::DropTargetEvent& event) { … }
int BrowserRootView::OnDragUpdated(const ui::DropTargetEvent& event) { … }
void BrowserRootView::OnDragExited() { … }
views::View::DropCallback BrowserRootView::GetDropCallback(
const ui::DropTargetEvent& event) { … }
bool BrowserRootView::OnMouseWheel(const ui::MouseWheelEvent& event) { … }
void BrowserRootView::OnMouseExited(const ui::MouseEvent& event) { … }
gfx::Size BrowserRootView::CalculatePreferredSize(
const views::SizeBounds& available_size) const { … }
void BrowserRootView::PaintChildren(const views::PaintInfo& paint_info) { … }
BrowserRootView::DropTarget* BrowserRootView::GetDropTarget(
const ui::DropTargetEvent& event) { … }
std::optional<BrowserRootView::DropIndex> BrowserRootView::GetDropIndexForEvent(
const ui::DropTargetEvent& event,
const ui::OSExchangeData& data,
DropTarget* target) { … }
void BrowserRootView::OnFilteringComplete(int sequence,
std::vector<GURL> urls) { … }
void BrowserRootView::SetOnFilteringCompleteClosureForTesting(
base::OnceClosure closure) { … }
std::optional<GURL> BrowserRootView::GetPasteAndGoURL(
const ui::OSExchangeData& data) { … }
void BrowserRootView::NavigateToDroppedUrls(
std::unique_ptr<DropInfo> drop_info,
const ui::DropTargetEvent& event,
ui::mojom::DragOperation& output_drag_op,
std::unique_ptr<ui::LayerTreeOwner> drag_image_layer_owner) { … }
BEGIN_METADATA(…)