Index: ui/views/widget/native_widget_mac.mm |
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..87e3f8dc89a43f73e7641900537e8de91e4eadf1 |
--- /dev/null |
+++ b/ui/views/widget/native_widget_mac.mm |
@@ -0,0 +1,265 @@ |
+// 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/widget/native_widget_mac.h" |
+ |
+#include <Cocoa/Cocoa.h> |
+ |
+#include "ui/native_theme/native_theme_mac.h" |
+ |
+namespace views { |
+namespace internal { |
+ |
+// static |
+NativeWidgetPrivate* NativeWidgetPrivate::CreateNativeWidget( |
+ internal::NativeWidgetDelegate* delegate) { |
+ return new NativeWidgetMac(delegate); |
+} |
+ |
+// static |
+NativeWidgetPrivate* NativeWidgetPrivate::GetNativeWidgetForNativeView( |
+ gfx::NativeView native_view) { |
+ return NULL; |
+} |
+ |
+// static |
+NativeWidgetPrivate* NativeWidgetPrivate::GetNativeWidgetForNativeWindow( |
+ gfx::NativeWindow native_window) { |
+ return NULL; |
+} |
+ |
+// static |
+NativeWidgetPrivate* NativeWidgetPrivate::GetTopLevelNativeWidget( |
+ gfx::NativeView native_view) { |
+ return NULL; |
+} |
+ |
+// static |
+void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view, |
+ Widget::Widgets* children) { |
+} |
+ |
+// static |
+void NativeWidgetPrivate::GetAllOwnedWidgets(gfx::NativeView native_view, |
+ Widget::Widgets* owned) { |
+} |
+ |
+// static |
+void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view, |
+ gfx::NativeView new_parent) { |
+} |
+ |
+// static |
+bool NativeWidgetPrivate::IsMouseButtonDown() { |
+ return false; |
+} |
+ |
+// static |
+bool NativeWidgetPrivate::IsTouchDown() { |
+ return false; |
+} |
+ |
+} // namespace internal |
+ |
+NativeWidgetMac::NativeWidgetMac(internal::NativeWidgetDelegate* delegate) |
+ : delegate_(delegate), |
+ window_(nil) { |
+} |
+ |
+void NativeWidgetMac::InitNativeWidget(const Widget::InitParams& params) {} |
+ |
+NonClientFrameView* NativeWidgetMac::CreateNonClientFrameView() { |
+ return NULL; |
+} |
+ |
+bool NativeWidgetMac::ShouldUseNativeFrame() const { |
+ return false; |
+} |
+ |
+bool NativeWidgetMac::ShouldWindowContentsBeTransparent() const { |
+ return false; |
+} |
+ |
+void NativeWidgetMac::FrameTypeChanged() { |
+ GetWidget()->ThemeChanged(); |
+ GetWidget()->GetRootView()->SchedulePaint(); |
+} |
+ |
+Widget* NativeWidgetMac::GetWidget() { |
+ return delegate_->AsWidget(); |
+} |
+ |
+const Widget* NativeWidgetMac::GetWidget() const { |
+ return delegate_->AsWidget(); |
+} |
+ |
+gfx::NativeView NativeWidgetMac::GetNativeView() const { |
+ return [window_ contentView]; |
+} |
+ |
+gfx::NativeWindow NativeWidgetMac::GetNativeWindow() const { |
+ return window_; |
+} |
+ |
+Widget* NativeWidgetMac::GetTopLevelWidget() { |
+ return NULL; |
+} |
+ |
+const ui::Compositor* NativeWidgetMac::GetCompositor() const { |
+ return NULL; |
+} |
+ |
+ui::Compositor* NativeWidgetMac::GetCompositor() { |
+ return NULL; |
+} |
+ |
+ui::Layer* NativeWidgetMac::GetLayer() { |
+ return NULL; |
+} |
+ |
+void NativeWidgetMac::ReorderNativeViews() { |
+} |
+ |
+void NativeWidgetMac::ViewRemoved(View* view) { |
+} |
+ |
+void NativeWidgetMac::SetNativeWindowProperty(const char* name, void* value) { |
+} |
+ |
+void* NativeWidgetMac::GetNativeWindowProperty(const char* name) const { |
+ return NULL; |
+} |
+ |
+TooltipManager* NativeWidgetMac::GetTooltipManager() const { |
+ return NULL; |
+} |
+ |
+void NativeWidgetMac::SetCapture() { |
+} |
+ |
+void NativeWidgetMac::ReleaseCapture() { |
+} |
+ |
+bool NativeWidgetMac::HasCapture() const { |
+ return false; |
+} |
+ |
+InputMethod* NativeWidgetMac::CreateInputMethod() { |
+ return NULL; |
+} |
+ |
+internal::InputMethodDelegate* NativeWidgetMac::GetInputMethodDelegate() { |
+ return NULL; |
+} |
+ |
+void NativeWidgetMac::CenterWindow(const gfx::Size& size) { |
+ [window_ center]; |
+} |
+ |
+void NativeWidgetMac::GetWindowPlacement( |
+ gfx::Rect* bounds, |
+ ui::WindowShowState* maximized) const { |
+ |
+} |
+ |
+bool NativeWidgetMac::SetWindowTitle(const base::string16& title) { |
+ return false; |
+} |
+ |
+void NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia& window_icon, |
+ const gfx::ImageSkia& app_icon) { |
+} |
+ |
+void NativeWidgetMac::InitModalType(ui::ModalType modal_type) { |
+ |
+} |
+ |
+gfx::Rect NativeWidgetMac::GetWindowBoundsInScreen() const { |
+ return gfx::Rect(); |
+} |
+ |
+gfx::Rect NativeWidgetMac::GetClientAreaBoundsInScreen() const { |
+ return gfx::Rect(); |
+} |
+ |
+gfx::Rect NativeWidgetMac::GetRestoredBounds() const { |
+ return gfx::Rect(); |
+} |
+ |
+void NativeWidgetMac::SetBounds(const gfx::Rect& bounds) {} |
+void NativeWidgetMac::SetSize(const gfx::Size& size) {} |
+void NativeWidgetMac::StackAbove(gfx::NativeView native_view) {} |
+void NativeWidgetMac::StackAtTop() {} |
+void NativeWidgetMac::StackBelow(gfx::NativeView native_view) {} |
+void NativeWidgetMac::SetShape(gfx::NativeRegion shape) {} |
+void NativeWidgetMac::Close() {} |
+void NativeWidgetMac::CloseNow() {} |
+void NativeWidgetMac::Show() {} |
+void NativeWidgetMac::Hide() {} |
+void NativeWidgetMac::ShowMaximizedWithBounds( |
+ const gfx::Rect& restored_bounds) {} |
+void NativeWidgetMac::ShowWithWindowState(ui::WindowShowState state) {} |
+bool NativeWidgetMac::IsVisible() const { return true; } |
+void NativeWidgetMac::Activate() {} |
+void NativeWidgetMac::Deactivate() {} |
+bool NativeWidgetMac::IsActive() const { return true; } |
+void NativeWidgetMac::SetAlwaysOnTop(bool always_on_top) {} |
+bool NativeWidgetMac::IsAlwaysOnTop() const { return false; } |
+void NativeWidgetMac::SetVisibleOnAllWorkspaces(bool always_visible) {} |
+void NativeWidgetMac::Maximize() {} |
+void NativeWidgetMac::Minimize() {} |
+bool NativeWidgetMac::IsMaximized() const { return false; } |
+bool NativeWidgetMac::IsMinimized() const { return false; } |
+void NativeWidgetMac::Restore() {} |
+void NativeWidgetMac::SetFullscreen(bool fullscreen) {} |
+bool NativeWidgetMac::IsFullscreen() const { return false; } |
+void NativeWidgetMac::SetOpacity(unsigned char opacity) {} |
+void NativeWidgetMac::SetUseDragFrame(bool use_drag_frame) {} |
+void NativeWidgetMac::FlashFrame(bool flash_frame) {} |
+void NativeWidgetMac::RunShellDrag(View* view, |
+ const ui::OSExchangeData& data, |
+ const gfx::Point& location, |
+ int operation, |
+ ui::DragDropTypes::DragEventSource source) {} |
+void NativeWidgetMac::SchedulePaintInRect(const gfx::Rect& rect) {} |
+void NativeWidgetMac::SetCursor(gfx::NativeCursor cursor) {} |
+bool NativeWidgetMac::IsMouseEventsEnabled() const { return true; } |
+void NativeWidgetMac::ClearNativeFocus() {} |
+ |
+gfx::Rect NativeWidgetMac::GetWorkAreaBoundsInScreen() const { |
+ return gfx::Rect(); |
+} |
+ |
+Widget::MoveLoopResult NativeWidgetMac::RunMoveLoop( |
+ const gfx::Vector2d& drag_offset, |
+ Widget::MoveLoopSource source, |
+ Widget::MoveLoopEscapeBehavior escape_behavior) { |
+ return Widget::MOVE_LOOP_CANCELED; |
+} |
+ |
+void NativeWidgetMac::EndMoveLoop() { |
+ |
+} |
+ |
+void NativeWidgetMac::SetVisibilityChangedAnimationsEnabled(bool value) { |
+ |
+} |
+ |
+ui::NativeTheme* NativeWidgetMac::GetNativeTheme() const { |
+ return ui::NativeTheme::instance(); |
+} |
+ |
+void NativeWidgetMac::OnRootViewLayout() const { |
+ |
+} |
+ |
+ui::EventHandler* NativeWidgetMac::GetEventHandler() { |
+ return NULL; |
+} |
+ |
+internal::NativeWidgetPrivate* NativeWidgetMac::AsNativeWidgetPrivate() { |
+ return this; |
+} |
+ |
+} // namespace views |