diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-25 15:39:58 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-25 15:39:58 +0000 |
commit | 41423098805b3f511e683123f2ff53c5fded1396 (patch) | |
tree | f9421f58c664b57c0f1953b5e089145f07ff0ae7 /views | |
parent | 2e2ed3b0a0325286ec7024d2d379fed9c141f8bb (diff) | |
download | chromium_src-41423098805b3f511e683123f2ff53c5fded1396.zip chromium_src-41423098805b3f511e683123f2ff53c5fded1396.tar.gz chromium_src-41423098805b3f511e683123f2ff53c5fded1396.tar.bz2 |
Add Aura support to views:
- change aura GYP_DEFINE to use_aura to be consistent with other switches
- add gfx::NativeView/Window typedefs
- add NativeWidgetAura/etc.
- update some ifdefs and includes to build on windows.
http://crbug.com/93944
TEST=none
Review URL: http://codereview.chromium.org/7741001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/menu/menu_controller.cc | 2 | ||||
-rw-r--r-- | views/desktop/desktop_window_view.cc | 8 | ||||
-rw-r--r-- | views/events/event_aura.cc | 127 | ||||
-rw-r--r-- | views/focus/focus_manager.cc | 2 | ||||
-rw-r--r-- | views/native_types.h | 14 | ||||
-rw-r--r-- | views/views.gyp | 19 | ||||
-rw-r--r-- | views/widget/default_theme_provider.cc | 4 | ||||
-rw-r--r-- | views/widget/native_widget_aura.cc | 268 | ||||
-rw-r--r-- | views/widget/native_widget_aura.h | 106 | ||||
-rw-r--r-- | views/widget/widget_unittest.cc | 16 | ||||
-rw-r--r-- | views/window/custom_frame_view.cc | 4 | ||||
-rw-r--r-- | views/window/native_frame_view.cc | 4 |
12 files changed, 557 insertions, 17 deletions
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc index cb53602..a87b9ea 100644 --- a/views/controls/menu/menu_controller.cc +++ b/views/controls/menu/menu_controller.cc @@ -1748,7 +1748,7 @@ bool MenuController::SelectByChar(char16 character) { return false; } -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) void MenuController::RepostEvent(SubmenuView* source, const MouseEvent& event) { if (!state_.item) { diff --git a/views/desktop/desktop_window_view.cc b/views/desktop/desktop_window_view.cc index 1c3c72f..e2bbaef 100644 --- a/views/desktop/desktop_window_view.cc +++ b/views/desktop/desktop_window_view.cc @@ -15,7 +15,9 @@ #include "views/widget/widget.h" #include "views/window/native_frame_view.h" -#if defined(OS_WIN) +#if defined(USE_AURA) +#include "views/widget/native_widget_aura.h" +#elif defined(OS_WIN) #include "views/widget/native_widget_win.h" #elif defined(TOOLKIT_USES_GTK) #include "views/widget/native_widget_gtk.h" @@ -137,7 +139,9 @@ void DesktopWindowView::CreateDesktopWindow(DesktopType type) { // In this environment, CreateChromeWindow will default to creating a views- // window, so we need to construct a NativeWidgetWin by hand. // TODO(beng): Replace this with NativeWindow::CreateNativeRootWindow(). -#if defined(OS_WIN) +#if defined(USE_AURA) + params.native_widget = new views::NativeWidgetAura(window); +#elif defined(OS_WIN) params.native_widget = new views::NativeWidgetWin(window); #elif defined(TOOLKIT_USES_GTK) params.native_widget = new views::NativeWidgetGtk(window); diff --git a/views/events/event_aura.cc b/views/events/event_aura.cc new file mode 100644 index 0000000..0a5a882 --- /dev/null +++ b/views/events/event_aura.cc @@ -0,0 +1,127 @@ +// Copyright (c) 2011 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 "views/events/event.h" + +#include "base/logging.h" + +namespace views { + +namespace { + +int GetKeyStateFlags() { + NOTIMPLEMENTED(); + return 0; +} + +ui::EventType EventTypeFromNative(NativeEvent native_event) { + NOTIMPLEMENTED(); + return ui::ET_UNKNOWN; +} + +int EventFlagsFromNative(NativeEvent native_event) { + NOTIMPLEMENTED(); + return 0; +} + +} + +//////////////////////////////////////////////////////////////////////////////// +// Event, private: + +void Event::Init() { +} + +void Event::InitWithNativeEvent(NativeEvent native_event) { + native_event_ = native_event; + // TODO(beng): remove once we rid views of Gtk/Gdk. + native_event_2_ = NULL; +} + +void Event::InitWithNativeEvent2(NativeEvent2 native_event_2, + FromNativeEvent2) { + // No one should ever call this on Aura. + // TODO(beng): remove once we rid views of Gtk/Gdk. + NOTREACHED(); + native_event_2_ = NULL; +} + +//////////////////////////////////////////////////////////////////////////////// +// LocatedEvent, protected: + +LocatedEvent::LocatedEvent(NativeEvent native_event) + : Event(native_event, EventTypeFromNative(native_event), + EventFlagsFromNative(native_event)), + location_(0, 0 /* TODO(beng): obtain */) { +} + +LocatedEvent::LocatedEvent(NativeEvent2 native_event_2, + FromNativeEvent2 from_native) + : Event(native_event_2, ui::ET_UNKNOWN, 0, from_native) { + // No one should ever call this on Windows. + // TODO(msw): remove once we rid views of Gtk/Gdk. + NOTREACHED(); +} + +//////////////////////////////////////////////////////////////////////////////// +// KeyEvent, public: + +KeyEvent::KeyEvent(NativeEvent native_event) + : Event(native_event, + EventTypeFromNative(native_event), + GetKeyStateFlags()), + key_code_(ui::VKEY_UNKNOWN /* TODO: obtain */), + character_(0), + unmodified_character_(0) { +} + +KeyEvent::KeyEvent(NativeEvent2 native_event_2, FromNativeEvent2 from_native) + : Event(native_event_2, ui::ET_UNKNOWN, 0, from_native) { + // No one should ever call this on Windows. + // TODO(beng): remove once we rid views of Gtk/Gdk. + NOTREACHED(); +} + +uint16 KeyEvent::GetCharacter() const { + NOTIMPLEMENTED(); + return key_code_; +} + +uint16 KeyEvent::GetUnmodifiedCharacter() const { + NOTIMPLEMENTED(); + return key_code_; +} + +//////////////////////////////////////////////////////////////////////////////// +// MouseEvent, public: + +MouseEvent::MouseEvent(NativeEvent native_event) + : LocatedEvent(native_event) { +} + +MouseEvent::MouseEvent(NativeEvent2 native_event_2, + FromNativeEvent2 from_native) + : LocatedEvent(native_event_2, from_native) { + // No one should ever call this on Windows. + // TODO(msw): remove once we rid views of Gtk/Gdk. + NOTREACHED(); +} + +//////////////////////////////////////////////////////////////////////////////// +// MouseWheelEvent, public: + +MouseWheelEvent::MouseWheelEvent(NativeEvent native_event) + : MouseEvent(native_event), + offset_(0 /* TODO(beng): obtain */) { +} + +MouseWheelEvent::MouseWheelEvent(NativeEvent2 native_event_2, + FromNativeEvent2 from_native) + : MouseEvent(native_event_2, from_native) { + // No one should ever call this on Windows. + // TODO(msw): remove once we rid views of Gtk/Gdk. + NOTREACHED(); +} + +} // namespace views diff --git a/views/focus/focus_manager.cc b/views/focus/focus_manager.cc index 4cdc5ae..499e0bc 100644 --- a/views/focus/focus_manager.cc +++ b/views/focus/focus_manager.cc @@ -90,7 +90,7 @@ bool FocusManager::OnKeyEvent(const KeyEvent& event) { // Note that we don't do focus traversal if the root window is not part of the // active window hierarchy as this would mean we have no focused view and // would focus the first focusable view. -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) HWND top_window = widget_->GetNativeView(); HWND active_window = ::GetActiveWindow(); if ((active_window == top_window || ::IsChild(active_window, top_window)) && diff --git a/views/native_types.h b/views/native_types.h index 7d8f503..0941879 100644 --- a/views/native_types.h +++ b/views/native_types.h @@ -15,6 +15,12 @@ typedef union _GdkEvent GdkEvent; typedef union _XEvent XEvent; #endif +#if defined(USE_AURA) +namespace aura { +class Event; +} +#endif + namespace views { // A note about NativeEvent and NativeEvent2. @@ -29,12 +35,14 @@ namespace views { // views, we can remove NativeEvent2 and typedef XEvent* to NativeEvent. The // world will then be beautiful(ish). -#if defined(OS_WIN) +#if defined(USE_AURA) +typedef aura::Event* NativeEvent; +#elif defined(OS_WIN) typedef MSG NativeEvent; -#endif -#if defined(OS_LINUX) +#elif defined(OS_LINUX) typedef GdkEvent* NativeEvent; #endif + #if defined(USE_X11) typedef XEvent* NativeEvent2; #else diff --git a/views/views.gyp b/views/views.gyp index 6a6416d..8415705 100644 --- a/views/views.gyp +++ b/views/views.gyp @@ -20,6 +20,11 @@ ['exclude', '_(touch)\\.cc$'], ], }], + ['use_aura==1', { + 'sources/': [ ['exclude', '_win\\.(h|cc)$'], + ['exclude', '_gtk\\.(h|cc)$'], + ['exclude', '_x\\.(h|cc)$'] ], + }], ], }, 'targets': [ @@ -230,6 +235,7 @@ 'drag_utils_win.cc', 'events/event.cc', 'events/event.h', + 'events/event_aura.cc', 'events/event_gtk.cc', 'events/event_win.cc', 'events/event_utils_win.cc', @@ -342,6 +348,8 @@ 'widget/monitor_win.cc', 'widget/monitor_win.h', 'widget/native_widget.h', + 'widget/native_widget_aura.cc', + 'widget/native_widget_aura.h', 'widget/native_widget_delegate.h', 'widget/native_widget_private.h', 'widget/native_widget_gtk.cc', @@ -378,6 +386,17 @@ '<(DEPTH)/third_party/wtl/include', ], 'conditions': [ + ['use_aura==1', { + 'dependencies': [ + '../aura/aura.gyp:aura', + ], + 'sources!': [ + 'controls/native_control.cc', + 'widget/aero_tooltip_manager.cc', + 'widget/child_window_message_processor.cc', + 'widget/child_window_message_processor.h', + ], + }], ['toolkit_uses_gtk == 1', { 'dependencies': [ '../build/linux/system.gyp:gtk', diff --git a/views/widget/default_theme_provider.cc b/views/widget/default_theme_provider.cc index 86c3b7b..6fdbb86 100644 --- a/views/widget/default_theme_provider.cc +++ b/views/widget/default_theme_provider.cc @@ -6,7 +6,7 @@ #include "ui/base/resource/resource_bundle.h" -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) #include "views/widget/native_widget_win.h" #endif @@ -32,7 +32,7 @@ bool DefaultThemeProvider::GetDisplayProperty(int id, int* result) const { } bool DefaultThemeProvider::ShouldUseNativeFrame() const { -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) return NativeWidgetWin::IsAeroGlassEnabled(); #else return false; diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc new file mode 100644 index 0000000..38d6d42 --- /dev/null +++ b/views/widget/native_widget_aura.cc @@ -0,0 +1,268 @@ +// Copyright (c) 2011 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 "views/widget/native_widget_aura.h" + +namespace views { + +//////////////////////////////////////////////////////////////////////////////// +// NativeWidgetAura, public: + +NativeWidgetAura::NativeWidgetAura(internal::NativeWidgetDelegate* delegate) { +} + +NativeWidgetAura::~NativeWidgetAura() { +} + +//////////////////////////////////////////////////////////////////////////////// +// NativeWidgetAura, internal::NativeWidgetPrivate implementation: + +void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { +} + +NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { + return NULL; +} + +void NativeWidgetAura::UpdateFrameAfterFrameChange() { +} + +bool NativeWidgetAura::ShouldUseNativeFrame() const { + return false; +} + +void NativeWidgetAura::FrameTypeChanged() { +} + +Widget* NativeWidgetAura::GetWidget() { + return NULL; +} + +const Widget* NativeWidgetAura::GetWidget() const { + return NULL; +} + +gfx::NativeView NativeWidgetAura::GetNativeView() const { + return NULL; +} + +gfx::NativeWindow NativeWidgetAura::GetNativeWindow() const { + return NULL; +} + +Widget* NativeWidgetAura::GetTopLevelWidget() { + NativeWidgetPrivate* native_widget = GetTopLevelNativeWidget(GetNativeView()); + return native_widget ? native_widget->GetWidget() : NULL; +} + +const ui::Compositor* NativeWidgetAura::GetCompositor() const { + return NULL; +} + +ui::Compositor* NativeWidgetAura::GetCompositor() { + return NULL; +} + +void NativeWidgetAura::MarkLayerDirty() { +} + +void NativeWidgetAura::CalculateOffsetToAncestorWithLayer(gfx::Point* offset, + View** ancestor) { +} + +void NativeWidgetAura::ViewRemoved(View* view) { +} + +void NativeWidgetAura::SetNativeWindowProperty(const char* name, void* value) { +} + +void* NativeWidgetAura::GetNativeWindowProperty(const char* name) const { + return NULL; +} + +TooltipManager* NativeWidgetAura::GetTooltipManager() const { + return NULL; +} + +bool NativeWidgetAura::IsScreenReaderActive() const { + return false; +} + +void NativeWidgetAura::SendNativeAccessibilityEvent( + View* view, + ui::AccessibilityTypes::Event event_type) { +} + +void NativeWidgetAura::SetMouseCapture() { +} + +void NativeWidgetAura::ReleaseMouseCapture() { +} + +bool NativeWidgetAura::HasMouseCapture() const { + return false; +} + +InputMethod* NativeWidgetAura::CreateInputMethod() { + return NULL; +} + +void NativeWidgetAura::CenterWindow(const gfx::Size& size) { +} + +void NativeWidgetAura::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, + bool* maximized) const { +} + +void NativeWidgetAura::SetWindowTitle(const std::wstring& title) { +} + +void NativeWidgetAura::SetWindowIcons(const SkBitmap& window_icon, + const SkBitmap& app_icon) { +} + +void NativeWidgetAura::SetAccessibleName(const std::wstring& name) { +} + +void NativeWidgetAura::SetAccessibleRole(ui::AccessibilityTypes::Role role) { +} + +void NativeWidgetAura::SetAccessibleState(ui::AccessibilityTypes::State state) { +} + +void NativeWidgetAura::BecomeModal() { +} + +gfx::Rect NativeWidgetAura::GetWindowScreenBounds() const { + return gfx::Rect(); +} + +gfx::Rect NativeWidgetAura::GetClientAreaScreenBounds() const { + return gfx::Rect(); +} + +gfx::Rect NativeWidgetAura::GetRestoredBounds() const { + return gfx::Rect(); +} + +void NativeWidgetAura::SetBounds(const gfx::Rect& bounds) { +} + +void NativeWidgetAura::SetSize(const gfx::Size& size) { +} + +void NativeWidgetAura::SetBoundsConstrained(const gfx::Rect& bounds, + Widget* other_widget) { +} + +void NativeWidgetAura::MoveAbove(gfx::NativeView native_view) { +} + +void NativeWidgetAura::MoveToTop() { + NOTIMPLEMENTED(); +} + +void NativeWidgetAura::SetShape(gfx::NativeRegion region) { +} + +void NativeWidgetAura::Close() { +} + +void NativeWidgetAura::CloseNow() { +} + +void NativeWidgetAura::EnableClose(bool enable) { +} + +void NativeWidgetAura::Show() { +} + +void NativeWidgetAura::Hide() { +} + +void NativeWidgetAura::ShowMaximizedWithBounds( + const gfx::Rect& restored_bounds) { +} + +void NativeWidgetAura::ShowWithState(ShowState state) { +} + +bool NativeWidgetAura::IsVisible() const { + return false; +} + +void NativeWidgetAura::Activate() { +} + +void NativeWidgetAura::Deactivate() { +} + +bool NativeWidgetAura::IsActive() const { + return false; +} + +void NativeWidgetAura::SetAlwaysOnTop(bool on_top) { +} + +void NativeWidgetAura::Maximize() { +} + +void NativeWidgetAura::Minimize() { +} + +bool NativeWidgetAura::IsMaximized() const { + return false; +} + +bool NativeWidgetAura::IsMinimized() const { + return false; +} + +void NativeWidgetAura::Restore() { +} + +void NativeWidgetAura::SetFullscreen(bool fullscreen) { +} + +bool NativeWidgetAura::IsFullscreen() const { + return false; +} + +void NativeWidgetAura::SetOpacity(unsigned char opacity) { +} + +void NativeWidgetAura::SetUseDragFrame(bool use_drag_frame) { +} + +bool NativeWidgetAura::IsAccessibleWidget() const { + return false; +} + +void NativeWidgetAura::RunShellDrag(View* view, + const ui::OSExchangeData& data, + int operation) { +} + +void NativeWidgetAura::SchedulePaintInRect(const gfx::Rect& rect) { +} + +void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { +} + +void NativeWidgetAura::ClearNativeFocus() { +} + +void NativeWidgetAura::FocusNativeView(gfx::NativeView native_view) { +} + +bool NativeWidgetAura::ConvertPointFromAncestor(const Widget* ancestor, + gfx::Point* point) const { + NOTREACHED(); + return false; +} + +void NativeWidgetAura::DispatchKeyEventPostIME(const KeyEvent& key) { +} + +} // namespace views diff --git a/views/widget/native_widget_aura.h b/views/widget/native_widget_aura.h new file mode 100644 index 0000000..ab3ff9c --- /dev/null +++ b/views/widget/native_widget_aura.h @@ -0,0 +1,106 @@ +// Copyright (c) 2011 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 VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ +#define VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ +#pragma once + +#include "views/widget/native_widget_private.h" + +namespace views { + +class NativeWidgetAura : public internal::NativeWidgetPrivate { + public: + explicit NativeWidgetAura(internal::NativeWidgetDelegate* delegate); + virtual ~NativeWidgetAura(); + + // Overridden from internal::NativeWidgetPrivate: + virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; + virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; + virtual void UpdateFrameAfterFrameChange() OVERRIDE; + virtual bool ShouldUseNativeFrame() 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 void MarkLayerDirty() OVERRIDE; + virtual void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, + View** ancestor) 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 bool IsScreenReaderActive() const OVERRIDE; + virtual void SendNativeAccessibilityEvent( + View* view, + ui::AccessibilityTypes::Event event_type) OVERRIDE; + virtual void SetMouseCapture() OVERRIDE; + virtual void ReleaseMouseCapture() OVERRIDE; + virtual bool HasMouseCapture() const OVERRIDE; + virtual InputMethod* CreateInputMethod() OVERRIDE; + virtual void CenterWindow(const gfx::Size& size) OVERRIDE; + virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, + bool* maximized) const OVERRIDE; + virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; + virtual void SetWindowIcons(const SkBitmap& window_icon, + const SkBitmap& app_icon) OVERRIDE; + virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; + virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE; + virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE; + virtual void BecomeModal() OVERRIDE; + virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE; + virtual gfx::Rect GetClientAreaScreenBounds() 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 SetBoundsConstrained(const gfx::Rect& bounds, + Widget* other_widget) OVERRIDE; + virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE; + virtual void MoveToTop() OVERRIDE; + virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; + virtual void Close() OVERRIDE; + virtual void CloseNow() OVERRIDE; + virtual void EnableClose(bool enable) OVERRIDE; + virtual void Show() OVERRIDE; + virtual void Hide() OVERRIDE; + virtual void ShowMaximizedWithBounds( + const gfx::Rect& restored_bounds) OVERRIDE; + virtual void ShowWithState(ShowState 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 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 bool IsAccessibleWidget() const OVERRIDE; + virtual void RunShellDrag(View* view, + const ui::OSExchangeData& data, + int operation) OVERRIDE; + virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; + virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; + virtual void ClearNativeFocus() OVERRIDE; + virtual void FocusNativeView(gfx::NativeView native_view) OVERRIDE; + virtual bool ConvertPointFromAncestor( + const Widget* ancestor, gfx::Point* point) const OVERRIDE; + virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(NativeWidgetAura); +}; + +} // namespace views + +#endif // VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ diff --git a/views/widget/widget_unittest.cc b/views/widget/widget_unittest.cc index 1ee027c..ee680ec 100644 --- a/views/widget/widget_unittest.cc +++ b/views/widget/widget_unittest.cc @@ -12,7 +12,9 @@ #include "views/test/views_test_base.h" #include "views/views_delegate.h" -#if defined(OS_WIN) +#if defined(USE_AURA) +#include "views/widget/native_widget_aura.h" +#elif defined(OS_WIN) #include "views/widget/native_widget_win.h" #elif defined(TOOLKIT_USES_GTK) #include "views/widget/native_widget_gtk.h" @@ -103,7 +105,9 @@ class WidgetTest : public ViewsTestBase { NativeWidget* CreatePlatformNativeWidget( internal::NativeWidgetDelegate* delegate) { -#if defined(OS_WIN) +#if defined(USE_AURA) + return new NativeWidgetAura(delegate); +#elif defined(OS_WIN) return new NativeWidgetWin(delegate); #elif defined(TOOLKIT_USES_GTK) return new NativeWidgetGtkCapture(delegate); @@ -336,7 +340,9 @@ struct OwnershipTestState { // A platform NativeWidget subclass that updates a bag of state when it is // destroyed. class OwnershipTestNativeWidget : -#if defined(OS_WIN) +#if defined(USE_AURA) + public NativeWidgetAura, +#elif defined(OS_WIN) public NativeWidgetWin { #elif defined(TOOLKIT_USES_GTK) public NativeWidgetGtk { @@ -344,7 +350,9 @@ class OwnershipTestNativeWidget : public: OwnershipTestNativeWidget(internal::NativeWidgetDelegate* delegate, OwnershipTestState* state) -#if defined(OS_WIN) +#if defined(USE_AURA) + : NativeWidgetAura(delegate), +#elif defined(OS_WIN) : NativeWidgetWin(delegate), #elif defined(TOOLKIT_USES_GTK) : NativeWidgetGtk(delegate), diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc index 0c18819..2d1b7a1 100644 --- a/views/window/custom_frame_view.cc +++ b/views/window/custom_frame_view.cc @@ -20,7 +20,7 @@ #include "views/window/hit_test.h" #endif -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) #include "views/widget/native_widget_win.h" #endif @@ -567,7 +567,7 @@ void CustomFrameView::LayoutClientView() { void CustomFrameView::InitClass() { static bool initialized = false; if (!initialized) { -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont()); #elif defined(OS_LINUX) // TODO(ben): need to resolve what font this is. diff --git a/views/window/native_frame_view.cc b/views/window/native_frame_view.cc index 2eafa23..8cb7dfd 100644 --- a/views/window/native_frame_view.cc +++ b/views/window/native_frame_view.cc @@ -7,7 +7,7 @@ #include "views/widget/native_widget.h" #include "views/widget/widget.h" -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) #include "views/widget/native_widget_win.h" #endif @@ -33,7 +33,7 @@ gfx::Rect NativeFrameView::GetBoundsForClientView() const { gfx::Rect NativeFrameView::GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const { -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) RECT rect = client_bounds.ToRECT(); NativeWidgetWin* widget_win = static_cast<NativeWidgetWin*>(frame_->native_widget()); |