2015-07-24 02:04:54 -06:00
|
|
|
// Copyright (c) 2015 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_UI_VIEWS_NATIVE_FRAME_VIEW_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_UI_VIEWS_NATIVE_FRAME_VIEW_H_
|
2015-07-24 02:04:54 -06:00
|
|
|
|
2023-05-11 14:07:39 -06:00
|
|
|
#include "base/memory/raw_ptr.h"
|
2024-02-21 13:27:05 -07:00
|
|
|
#include "ui/base/metadata/metadata_header_macros.h"
|
2015-07-24 02:04:54 -06:00
|
|
|
#include "ui/views/window/native_frame_view.h"
|
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
namespace electron {
|
2015-07-24 02:04:54 -06:00
|
|
|
|
2015-10-05 05:05:59 -06:00
|
|
|
class NativeWindow;
|
2015-07-24 02:04:54 -06:00
|
|
|
|
|
|
|
// Like the views::NativeFrameView, but returns the min/max size from the
|
|
|
|
// NativeWindowViews.
|
|
|
|
class NativeFrameView : public views::NativeFrameView {
|
2024-02-21 13:27:05 -07:00
|
|
|
METADATA_HEADER(NativeFrameView, views::NativeFrameView)
|
|
|
|
|
2015-07-24 02:04:54 -06:00
|
|
|
public:
|
2015-10-05 05:05:59 -06:00
|
|
|
NativeFrameView(NativeWindow* window, views::Widget* widget);
|
2015-07-24 02:04:54 -06:00
|
|
|
|
2021-11-03 05:41:45 -06:00
|
|
|
// disable copy
|
|
|
|
NativeFrameView(const NativeFrameView&) = delete;
|
|
|
|
NativeFrameView& operator=(const NativeFrameView&) = delete;
|
|
|
|
|
2015-07-24 02:04:54 -06:00
|
|
|
protected:
|
|
|
|
// views::View:
|
|
|
|
gfx::Size GetMinimumSize() const override;
|
|
|
|
gfx::Size GetMaximumSize() const override;
|
|
|
|
|
|
|
|
private:
|
2023-05-11 14:07:39 -06:00
|
|
|
raw_ptr<NativeWindow> window_; // weak ref.
|
2015-07-24 02:04:54 -06:00
|
|
|
};
|
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
} // namespace electron
|
2015-07-24 02:04:54 -06:00
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_UI_VIEWS_NATIVE_FRAME_VIEW_H_
|