summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/root_window_host.h3
-rw-r--r--ui/views/widget/desktop_native_widget_aura.cc3
-rw-r--r--ui/views/widget/desktop_root_window_host.h3
-rw-r--r--ui/views/widget/desktop_root_window_host_win.cc6
-rw-r--r--ui/views/widget/desktop_root_window_host_win.h12
-rw-r--r--ui/views/widget/widget.cc2
-rw-r--r--ui/views/widget/widget.h6
7 files changed, 28 insertions, 7 deletions
diff --git a/ui/aura/root_window_host.h b/ui/aura/root_window_host.h
index ee5eb20..5105fa9 100644
--- a/ui/aura/root_window_host.h
+++ b/ui/aura/root_window_host.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/message_loop.h"
+#include "ui/aura/aura_export.h"
#include "ui/base/cursor/cursor.h"
#include "ui/gfx/native_widget_types.h"
@@ -25,7 +26,7 @@ class RootWindowHostDelegate;
// RootWindowHost bridges between a native window and the embedded RootWindow.
// It provides the accelerated widget and maps events from the native os to
// aura.
-class RootWindowHost {
+class AURA_EXPORT RootWindowHost {
public:
virtual ~RootWindowHost() {}
diff --git a/ui/views/widget/desktop_native_widget_aura.cc b/ui/views/widget/desktop_native_widget_aura.cc
index 159265a..601d745 100644
--- a/ui/views/widget/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_native_widget_aura.cc
@@ -34,7 +34,8 @@ void DesktopNativeWidgetAura::InitNativeWidget(
window_->Init(params.layer_type);
window_->Show();
- desktop_root_window_host_ =
+ desktop_root_window_host_ = params.desktop_root_window_host ?
+ params.desktop_root_window_host :
DesktopRootWindowHost::Create(native_widget_delegate_, params.bounds);
desktop_root_window_host_->Init(window_, params);
}
diff --git a/ui/views/widget/desktop_root_window_host.h b/ui/views/widget/desktop_root_window_host.h
index 3a518db..8071bba 100644
--- a/ui/views/widget/desktop_root_window_host.h
+++ b/ui/views/widget/desktop_root_window_host.h
@@ -6,6 +6,7 @@
#define UI_VIEWS_WIDGET_DESKTOP_ROOT_WINDOW_HOST_H_
#include "ui/base/ui_base_types.h"
+#include "ui/views/views_export.h"
#include "ui/views/widget/widget.h"
namespace aura {
@@ -24,7 +25,7 @@ class InputMethodDelegate;
class NativeWidgetDelegate;
}
-class DesktopRootWindowHost {
+class VIEWS_EXPORT DesktopRootWindowHost {
public:
virtual ~DesktopRootWindowHost() {}
diff --git a/ui/views/widget/desktop_root_window_host_win.cc b/ui/views/widget/desktop_root_window_host_win.cc
index 781bac1..753ea8f 100644
--- a/ui/views/widget/desktop_root_window_host_win.cc
+++ b/ui/views/widget/desktop_root_window_host_win.cc
@@ -520,6 +520,8 @@ void DesktopRootWindowHostWin::HandleCreate() {
// TODO(beng): moar
NOTIMPLEMENTED();
+ native_widget_delegate_->OnNativeWidgetCreated();
+
// 1. Window property association
// 2. MouseWheel.
// 3. Drop target.
@@ -680,6 +682,10 @@ const Widget* DesktopRootWindowHostWin::GetWidget() const {
return native_widget_delegate_->AsWidget();
}
+HWND DesktopRootWindowHostWin::GetHWND() {
+ return message_handler_->hwnd();
+}
+
////////////////////////////////////////////////////////////////////////////////
// DesktopRootWindowHost, public:
diff --git a/ui/views/widget/desktop_root_window_host_win.h b/ui/views/widget/desktop_root_window_host_win.h
index 0e68f52..9b4d41a 100644
--- a/ui/views/widget/desktop_root_window_host_win.h
+++ b/ui/views/widget/desktop_root_window_host_win.h
@@ -6,6 +6,7 @@
#define UI_VIEWS_WIDGET_DESKTOP_ROOT_WINDOW_HOST_WIN_H_
#include "ui/aura/root_window_host.h"
+#include "ui/views/views_export.h"
#include "ui/views/widget/desktop_root_window_host.h"
#include "ui/views/win/hwnd_message_handler_delegate.h"
@@ -23,16 +24,17 @@ namespace views {
class DesktopCaptureClient;
class HWNDMessageHandler;
-class DesktopRootWindowHostWin : public DesktopRootWindowHost,
- public aura::RootWindowHost,
- public HWNDMessageHandlerDelegate {
+class VIEWS_EXPORT DesktopRootWindowHostWin
+ : public DesktopRootWindowHost,
+ public aura::RootWindowHost,
+ public HWNDMessageHandlerDelegate {
public:
DesktopRootWindowHostWin(
internal::NativeWidgetDelegate* native_widget_delegate,
const gfx::Rect& initial_bounds);
virtual ~DesktopRootWindowHostWin();
- private:
+ protected:
// Overridden from DesktopRootWindowHost:
virtual void Init(aura::Window* content_window,
const Widget::InitParams& params) OVERRIDE;
@@ -186,7 +188,9 @@ class DesktopRootWindowHostWin : public DesktopRootWindowHost,
Widget* GetWidget();
const Widget* GetWidget() const;
+ HWND GetHWND();
+ private:
scoped_ptr<aura::RootWindow> root_window_;
scoped_ptr<HWNDMessageHandler> message_handler_;
scoped_ptr<DesktopCaptureClient> capture_client_;
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 51c4fe0b..1677c82 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -156,6 +156,7 @@ Widget::InitParams::InitParams()
parent(NULL),
parent_widget(NULL),
native_widget(NULL),
+ desktop_root_window_host(NULL),
top_level(false),
layer_type(ui::LAYER_TEXTURED) {
}
@@ -180,6 +181,7 @@ Widget::InitParams::InitParams(Type type)
parent(NULL),
parent_widget(NULL),
native_widget(NULL),
+ desktop_root_window_host(NULL),
top_level(false),
layer_type(ui::LAYER_TEXTURED) {
}
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index 0379cf5..48f1295 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -53,6 +53,7 @@ enum TouchStatus;
namespace views {
class DefaultThemeProvider;
+class DesktopRootWindowHost;
class InputMethod;
class NativeWidget;
class NonClientFrameView;
@@ -181,6 +182,11 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// When set, this value is used as the Widget's NativeWidget implementation.
// The Widget will not construct a default one. Default is NULL.
NativeWidget* native_widget;
+ // Aura-only. Provides a DesktopRootWindowHost implementation to use instead
+ // of the default one.
+ // TODO(beng): Figure out if there's a better way to expose this, e.g. get
+ // rid of NW subclasses and do this all via message handling.
+ DesktopRootWindowHost* desktop_root_window_host;
bool top_level;
// Only used by NativeWidgetAura. Specifies the type of layer for the
// aura::Window. Default is LAYER_TEXTURED.