Commit d4bf47a5 authored by tapted@chromium.org's avatar tapted@chromium.org

MacViews: Adds NativeWidgetMac and gets views target compiling on Mac.

This is a minimal amount to get the `views` target compiling on Mac. It
adds an implementation of NativeWidgetMac that spews NOTIMPLEMENTED().
So, nothing works yet, but this gives an FYI builder something to chew
on to catch regressions in things ported so far.

BUG=366007

Review URL: https://codereview.chromium.org/249113002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272849 0039d316-1c4b-4281-b951-d872f2087c98
parent f802c349
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
'gestures/gesture_recognizer.h', 'gestures/gesture_recognizer.h',
'gestures/gesture_recognizer_impl.cc', 'gestures/gesture_recognizer_impl.cc',
'gestures/gesture_recognizer_impl.h', 'gestures/gesture_recognizer_impl.h',
'gestures/gesture_recognizer_impl_mac.cc',
'gestures/gesture_sequence.cc', 'gestures/gesture_sequence.cc',
'gestures/gesture_sequence.h', 'gestures/gesture_sequence.h',
'gestures/gesture_types.h', 'gestures/gesture_types.h',
......
// Copyright 2014 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 "base/macros.h"
#include "ui/events/gestures/gesture_recognizer.h"
namespace ui {
namespace {
// Stub implementation of GestureRecognizer for Mac. Currently only serves to
// provide a no-op implementation of TransferEventsTo().
class GestureRecognizerImplMac : public GestureRecognizer {
public:
GestureRecognizerImplMac() {}
virtual ~GestureRecognizerImplMac() {}
private:
virtual Gestures* ProcessTouchEventForGesture(
const TouchEvent& event,
ui::EventResult result,
GestureConsumer* consumer) OVERRIDE {
return NULL;
}
virtual bool CleanupStateForConsumer(GestureConsumer* consumer) OVERRIDE {
return false;
}
virtual GestureConsumer* GetTouchLockedTarget(
const TouchEvent& event) OVERRIDE {
return NULL;
}
virtual GestureConsumer* GetTargetForGestureEvent(
const GestureEvent& event) OVERRIDE {
return NULL;
}
virtual GestureConsumer* GetTargetForLocation(const gfx::PointF& location,
int source_device_id) OVERRIDE {
return NULL;
}
virtual void TransferEventsTo(GestureConsumer* current_consumer,
GestureConsumer* new_consumer) OVERRIDE {}
virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer,
gfx::PointF* point) OVERRIDE {
return false;
}
virtual bool CancelActiveTouches(GestureConsumer* consumer) OVERRIDE {
return false;
}
virtual void AddGestureEventHelper(GestureEventHelper* helper) OVERRIDE {}
virtual void RemoveGestureEventHelper(GestureEventHelper* helper) OVERRIDE {}
DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImplMac);
};
} // namespace
// static
GestureRecognizer* GestureRecognizer::Get() {
CR_DEFINE_STATIC_LOCAL(GestureRecognizerImplMac, instance, ());
return &instance;
}
} // namespace ui
...@@ -124,6 +124,7 @@ typedef UIEvent* NativeEvent; ...@@ -124,6 +124,7 @@ typedef UIEvent* NativeEvent;
typedef NSCursor* NativeCursor; typedef NSCursor* NativeCursor;
typedef NSView* NativeView; typedef NSView* NativeView;
typedef NSWindow* NativeWindow; typedef NSWindow* NativeWindow;
typedef void* NativeRegion;
typedef NSEvent* NativeEvent; typedef NSEvent* NativeEvent;
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
typedef void* NativeCursor; typedef void* NativeCursor;
......
// Copyright 2014 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 "ui/views/controls/native/native_view_host_wrapper.h"
namespace views {
////////////////////////////////////////////////////////////////////////////////
// NativeViewHostWrapper, public:
// static
NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper(
NativeViewHost* host) {
return NULL;
}
} // namespace views
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
'../aura/aura.gyp:aura', '../aura/aura.gyp:aura',
'../wm/wm.gyp:wm', '../wm/wm.gyp:wm',
], ],
}, { # use_aura==0
'sources/': [
['exclude', '^corewm/'],
['exclude', '^touchui/'],
['exclude', '^widget/desktop_aura/']
]
}], }],
], ],
}, },
...@@ -182,6 +188,7 @@ ...@@ -182,6 +188,7 @@
'controls/native/native_view_host.h', 'controls/native/native_view_host.h',
'controls/native/native_view_host_aura.cc', 'controls/native/native_view_host_aura.cc',
'controls/native/native_view_host_aura.h', 'controls/native/native_view_host_aura.h',
'controls/native/native_view_host_mac.cc',
'controls/prefix_delegate.h', 'controls/prefix_delegate.h',
'controls/prefix_selector.cc', 'controls/prefix_selector.cc',
'controls/prefix_selector.h', 'controls/prefix_selector.h',
...@@ -406,6 +413,8 @@ ...@@ -406,6 +413,8 @@
'widget/native_widget_aura.cc', 'widget/native_widget_aura.cc',
'widget/native_widget_aura.h', 'widget/native_widget_aura.h',
'widget/native_widget_delegate.h', 'widget/native_widget_delegate.h',
'widget/native_widget_mac.h',
'widget/native_widget_mac.mm',
'widget/native_widget_private.h', 'widget/native_widget_private.h',
'widget/tooltip_manager_aura.cc', 'widget/tooltip_manager_aura.cc',
'widget/tooltip_manager_aura.h', 'widget/tooltip_manager_aura.h',
...@@ -539,6 +548,27 @@ ...@@ -539,6 +548,27 @@
'../events/platform/x11/x11_events_platform.gyp:x11_events_platform', '../events/platform/x11/x11_events_platform.gyp:x11_events_platform',
], ],
}], }],
['use_aura==0', {
'sources!': [
'accessibility/ax_aura_obj_cache.cc',
'accessibility/ax_aura_obj_cache.h',
'accessibility/ax_aura_obj_wrapper.h',
'accessibility/ax_view_obj_wrapper.cc',
'accessibility/ax_view_obj_wrapper.h',
'accessibility/ax_widget_obj_wrapper.cc',
'accessibility/ax_widget_obj_wrapper.h',
'accessibility/ax_window_obj_wrapper.cc',
'accessibility/ax_window_obj_wrapper.h',
'bubble/bubble_window_targeter.cc',
'bubble/bubble_window_targeter.h',
'bubble/tray_bubble_view.cc',
'bubble/tray_bubble_view.h',
'mouse_watcher_view_host.cc',
'mouse_watcher_view_host.h',
'widget/window_reorderer.cc',
'widget/window_reorderer.h',
],
}],
], ],
}, # target_name: views }, # target_name: views
{ {
......
// Copyright 2014 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 UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_
#define UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_
#include "base/mac/scoped_nsobject.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/widget/native_widget_private.h"
namespace views {
class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate {
public:
NativeWidgetMac(internal::NativeWidgetDelegate* delegate);
virtual ~NativeWidgetMac();
protected:
// internal::NativeWidgetPrivate:
virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
virtual bool ShouldUseNativeFrame() const OVERRIDE;
virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE;
virtual void FrameTypeChanged() OVERRIDE;
virtual Widget* GetWidget() OVERRIDE;
virtual const Widget* GetWidget() const OVERRIDE;
virtual gfx::NativeView GetNativeView() const OVERRIDE;
virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE;
virtual Widget* GetTopLevelWidget() OVERRIDE;
virtual const ui::Compositor* GetCompositor() const OVERRIDE;
virtual ui::Compositor* GetCompositor() OVERRIDE;
virtual ui::Layer* GetLayer() OVERRIDE;
virtual void ReorderNativeViews() OVERRIDE;
virtual void ViewRemoved(View* view) OVERRIDE;
virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE;
virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE;
virtual TooltipManager* GetTooltipManager() const OVERRIDE;
virtual void SetCapture() OVERRIDE;
virtual void ReleaseCapture() OVERRIDE;
virtual bool HasCapture() const OVERRIDE;
virtual InputMethod* CreateInputMethod() OVERRIDE;
virtual InputMethodDelegate* GetInputMethodDelegate() OVERRIDE;
virtual ui::InputMethod* GetHostInputMethod() OVERRIDE;
virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
virtual void GetWindowPlacement(
gfx::Rect* bounds,
ui::WindowShowState* maximized) const OVERRIDE;
virtual bool SetWindowTitle(const base::string16& title) OVERRIDE;
virtual void SetWindowIcons(const gfx::ImageSkia& window_icon,
const gfx::ImageSkia& app_icon) OVERRIDE;
virtual void InitModalType(ui::ModalType modal_type) OVERRIDE;
virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE;
virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE;
virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
virtual void StackAbove(gfx::NativeView native_view) OVERRIDE;
virtual void StackAtTop() OVERRIDE;
virtual void StackBelow(gfx::NativeView native_view) OVERRIDE;
virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
virtual void Close() OVERRIDE;
virtual void CloseNow() OVERRIDE;
virtual void Show() OVERRIDE;
virtual void Hide() OVERRIDE;
virtual void ShowMaximizedWithBounds(
const gfx::Rect& restored_bounds) OVERRIDE;
virtual void ShowWithWindowState(ui::WindowShowState state) OVERRIDE;
virtual bool IsVisible() const OVERRIDE;
virtual void Activate() OVERRIDE;
virtual void Deactivate() OVERRIDE;
virtual bool IsActive() const OVERRIDE;
virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
virtual bool IsAlwaysOnTop() const OVERRIDE;
virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE;
virtual void Maximize() OVERRIDE;
virtual void Minimize() OVERRIDE;
virtual bool IsMaximized() const OVERRIDE;
virtual bool IsMinimized() const OVERRIDE;
virtual void Restore() OVERRIDE;
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
virtual bool IsFullscreen() const OVERRIDE;
virtual void SetOpacity(unsigned char opacity) OVERRIDE;
virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
virtual void FlashFrame(bool flash_frame) OVERRIDE;
virtual void RunShellDrag(View* view,
const ui::OSExchangeData& data,
const gfx::Point& location,
int operation,
ui::DragDropTypes::DragEventSource source) OVERRIDE;
virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
virtual bool IsMouseEventsEnabled() const OVERRIDE;
virtual void ClearNativeFocus() OVERRIDE;
virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE;
virtual Widget::MoveLoopResult RunMoveLoop(
const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source,
Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE;
virtual void EndMoveLoop() OVERRIDE;
virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE;
virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE;
virtual void OnRootViewLayout() const OVERRIDE;
// NativeWidget:
virtual ui::EventHandler* GetEventHandler() OVERRIDE;
private:
internal::NativeWidgetDelegate* delegate_;
base::scoped_nsobject<NSWindow> window_;
DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac);
};
} // namespace views
#endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment