blob: 7057931f2c9d98f32e190d542dba03a78f49eb05 [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.
#ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_ROUNDED_OMNIBOX_RESULTS_FRAME_H_
#define CHROME_BROWSER_UI_VIEWS_OMNIBOX_ROUNDED_OMNIBOX_RESULTS_FRAME_H_
#include "ui/gfx/geometry/insets.h"
#include "ui/views/metadata/metadata_header_macros.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 {
public:
METADATA_HEADER(RoundedOmniboxResultsFrame);
RoundedOmniboxResultsFrame(views::View* contents,
LocationBarView* location_bar);
RoundedOmniboxResultsFrame(const RoundedOmniboxResultsFrame&) = delete;
RoundedOmniboxResultsFrame& operator=(const RoundedOmniboxResultsFrame&) =
delete;
~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:
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
private:
views::View* top_background_ = nullptr;
views::View* contents_host_ = nullptr;
views::View* contents_;
};
#endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_ROUNDED_OMNIBOX_RESULTS_FRAME_H_