blob: 3ea218676952d7a8c7bf70f916bb52705be6ab79 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include "ui/gfx/geometry/insets.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
class LocationBarView;
// A class that wraps a Widget's content view to provide a custom results frame.
class RoundedOmniboxResultsFrame : public views::View {
RoundedOmniboxResultsFrame(views::View* contents,
const LocationBarView* location_bar);
~RoundedOmniboxResultsFrame() override;
// Hook to customize Widget initialization.
static void OnBeforeWidgetInit(views::Widget::InitParams* params,
views::Widget* widget);
// The height of the location bar view part of the omnibox popup.
static int GetNonResultSectionHeight();
// How the Widget is aligned relative to the location bar.
static gfx::Insets GetLocationBarAlignmentInsets();
// Returns the blur region taken up by the Omnibox popup shadows.
static gfx::Insets GetShadowInsets();
// views::View:
const char* GetClassName() const override;
void Layout() override;
void AddedToWidget() override;
#if !defined(USE_AURA)
void OnMouseMoved(const ui::MouseEvent& event) override;
void OnMouseEvent(ui::MouseEvent* event) override;
#endif // !USE_AURA
std::unique_ptr<ui::LayerOwner> contents_mask_;
views::View* top_background_ = nullptr;
views::View* contents_host_ = nullptr;
views::View* contents_;