Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Unified Diff: ui/views/views_delegate.h

Issue 2746763007: Adds a factory function to ViewsDelegate for DesktopWindowTreeHost (Closed)
Patch Set: cleanup Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/mus_client.cc ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/views_delegate.h
diff --git a/ui/views/views_delegate.h b/ui/views/views_delegate.h
index 6a784af5fabab6edee098c241b1e1f4e09ff8352..04324b50a4edba52b08125bd4bd80a32b436a015 100644
--- a/ui/views/views_delegate.h
+++ b/ui/views/views_delegate.h
@@ -5,6 +5,7 @@
#ifndef UI_VIEWS_VIEWS_DELEGATE_H_
#define UI_VIEWS_VIEWS_DELEGATE_H_
+#include <memory>
#include <string>
#if defined(OS_WIN)
@@ -51,6 +52,8 @@ class View;
class Widget;
#if defined(USE_AURA)
+class DesktopNativeWidgetAura;
+class DesktopWindowTreeHost;
class TouchSelectionMenuRunnerViews;
#endif
@@ -98,6 +101,14 @@ class VIEWS_EXPORT ViewsDelegate {
using NativeWidgetFactory =
base::Callback<NativeWidget*(const Widget::InitParams&,
internal::NativeWidgetDelegate*)>;
+#if defined(USE_AURA)
+ using DesktopWindowTreeHostFactory =
+ base::Callback<std::unique_ptr<DesktopWindowTreeHost>(
+ const Widget::InitParams&,
+ internal::NativeWidgetDelegate*,
+ DesktopNativeWidgetAura*)>;
+#endif
+
#if defined(OS_WIN)
enum AppbarAutohideEdge {
EDGE_TOP = 1 << 0,
@@ -124,13 +135,22 @@ class VIEWS_EXPORT ViewsDelegate {
// Call this method to set a factory callback that will be used to construct
// NativeWidget implementations overriding the platform defaults.
- void set_native_widget_factory(NativeWidgetFactory factory) {
+ void set_native_widget_factory(const NativeWidgetFactory& factory) {
native_widget_factory_ = factory;
}
- const NativeWidgetFactory& native_widget_factory() {
+ const NativeWidgetFactory& native_widget_factory() const {
return native_widget_factory_;
}
+#if defined(USE_AURA)
+ void set_desktop_window_tree_host_factory(
+ const DesktopWindowTreeHostFactory& factory) {
+ desktop_window_tree_host_factory_ = factory;
+ }
+ const DesktopWindowTreeHostFactory& desktop_window_tree_host_factory() const {
+ return desktop_window_tree_host_factory_;
+ }
+#endif
// Saves the position, size and "show" state for the window with the
// specified name.
virtual void SaveWindowPlacement(const Widget* widget,
@@ -240,6 +260,8 @@ class VIEWS_EXPORT ViewsDelegate {
#if defined(USE_AURA)
std::unique_ptr<TouchSelectionMenuRunnerViews> touch_selection_menu_runner_;
+
+ DesktopWindowTreeHostFactory desktop_window_tree_host_factory_;
#endif
NativeWidgetFactory native_widget_factory_;
« no previous file with comments | « ui/views/mus/mus_client.cc ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698