Fix scroll conflict

This commit is contained in:
Anthony Tseng 2016-08-01 18:01:21 +08:00
parent 5eeadb0ad4
commit 1aedccaeeb
2 changed files with 55 additions and 7 deletions

View file

@ -12,6 +12,7 @@
#include "base/mac/scoped_nsobject.h"
#include "atom/browser/native_window.h"
#include "content/public/browser/render_widget_host.h"
@class AtomNSWindow;
@class AtomNSWindowDelegate;
@ -19,7 +20,8 @@
namespace atom {
class NativeWindowMac : public NativeWindow {
class NativeWindowMac : public NativeWindow,
public content::RenderWidgetHost::InputEventObserver {
public:
NativeWindowMac(brightray::InspectableWebContents* inspectable_web_contents,
const mate::Dictionary& options,
@ -90,6 +92,8 @@ class NativeWindowMac : public NativeWindow {
void SetVisibleOnAllWorkspaces(bool visible) override;
bool IsVisibleOnAllWorkspaces() override;
void OnInputEvent(const blink::WebInputEvent& event) override;
// Refresh the DraggableRegion views.
void UpdateDraggableRegionViews() {
UpdateDraggableRegionViews(draggable_regions_);
@ -126,6 +130,11 @@ class NativeWindowMac : public NativeWindow {
// whehter we can drag.
void UpdateDraggableRegionViews(const std::vector<DraggableRegion>& regions);
void RegisterInputEventObserver(content::RenderViewHost* host);
void UnregisterInputEventObserver(content::RenderViewHost* host);
void RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host);
base::scoped_nsobject<AtomNSWindow> window_;
base::scoped_nsobject<AtomNSWindowDelegate> window_delegate_;
@ -147,6 +156,8 @@ class NativeWindowMac : public NativeWindow {
// The "titleBarStyle" option.
TitleBarStyle title_bar_style_;
bool is_edge_;
DISALLOW_COPY_AND_ASSIGN(NativeWindowMac);
};