refactor: Make NativeWindow inherit WidgetDelegate
This commit is contained in:
parent
ee2c3607ad
commit
6d18bd0633
4 changed files with 8 additions and 7 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "base/supports_user_data.h"
|
||||
#include "content/public/browser/web_contents_user_data.h"
|
||||
#include "extensions/browser/app_window/size_constraints.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
|
||||
class SkRegion;
|
||||
|
||||
|
@ -47,7 +48,8 @@ class NativeBrowserView;
|
|||
|
||||
struct DraggableRegion;
|
||||
|
||||
class NativeWindow : public base::SupportsUserData {
|
||||
class NativeWindow : public base::SupportsUserData,
|
||||
public views::WidgetDelegate {
|
||||
public:
|
||||
~NativeWindow() override;
|
||||
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
|
||||
#include "atom/browser/native_window.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
#include "ui/views/widget/widget_observer.h"
|
||||
|
||||
@class AtomNSWindow;
|
||||
@class AtomNSWindowDelegate;
|
||||
|
@ -23,8 +21,7 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
class NativeWindowMac : public NativeWindow,
|
||||
public views::WidgetDelegate {
|
||||
class NativeWindowMac : public NativeWindow {
|
||||
public:
|
||||
NativeWindowMac(const mate::Dictionary& options, NativeWindow* parent);
|
||||
~NativeWindowMac() override;
|
||||
|
|
|
@ -138,6 +138,9 @@ NativeWindowViews::NativeWindowViews(const mate::Dictionary& options,
|
|||
maximizable_(true),
|
||||
minimizable_(true),
|
||||
fullscreenable_(true) {
|
||||
// The root view is this class, it is managed by us.
|
||||
set_owned_by_client();
|
||||
|
||||
options.Get(options::kTitle, &title_);
|
||||
options.Get(options::kAutoHideMenuBar, &menu_bar_autohide_);
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "atom/browser/ui/accelerator_util.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
#include "ui/views/widget/widget_observer.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
|
@ -41,7 +40,7 @@ class NativeWindowViews : public NativeWindow,
|
|||
#if defined(OS_WIN)
|
||||
public MessageHandlerDelegate,
|
||||
#endif
|
||||
public views::WidgetDelegateView,
|
||||
public views::View,
|
||||
public views::WidgetObserver {
|
||||
public:
|
||||
NativeWindowViews(const mate::Dictionary& options, NativeWindow* parent);
|
||||
|
|
Loading…
Reference in a new issue