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

Unified Diff: ui/views/mus/mus_client.cc

Issue 2514243002: Propagates window type properties during aura-mus window creation (Closed)
Patch Set: return Created 4 years, 1 month 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
Index: ui/views/mus/mus_client.cc
diff --git a/ui/views/mus/mus_client.cc b/ui/views/mus/mus_client.cc
index 3b2b4139c7a83ff926505701bbba8712cc0dd4df..4eeac2acbc0c5b0e9acf6633e0f0f54f3ebe7b09 100644
--- a/ui/views/mus/mus_client.cc
+++ b/ui/views/mus/mus_client.cc
@@ -9,7 +9,9 @@
#include "services/service_manager/public/cpp/connection.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/ui/public/cpp/gpu/gpu_service.h"
+#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/event_matcher.mojom.h"
+#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/aura/env.h"
#include "ui/aura/mus/mus_context_factory.h"
#include "ui/aura/mus/os_exchange_data_provider_mus.h"
@@ -57,6 +59,18 @@ bool MusClient::ShouldCreateDesktopNativeWidgetAura(
!init_params.child;
}
+// static
+std::map<std::string, std::vector<uint8_t>>
+MusClient::ConfigurePropertiesFromParams(
+ const Widget::InitParams& init_params) {
+ std::map<std::string, std::vector<uint8_t>> mus_properties =
+ init_params.mus_properties;
+ mus_properties[ui::mojom::WindowManager::kWindowType_Property] =
+ mojo::ConvertTo<std::vector<uint8_t>>(
+ static_cast<int32_t>(init_params.type));
msw 2016/11/21 19:26:47 Hmm, this sets kWindowType_Property to a Widget::I
sky 2016/11/21 22:13:56 Done.
+ return mus_properties;
+}
+
NativeWidget* MusClient::CreateNativeWidget(
const Widget::InitParams& init_params,
internal::NativeWidgetDelegate* delegate) {
@@ -71,9 +85,14 @@ NativeWidget* MusClient::CreateNativeWidget(
native_widget->SetDesktopWindowTreeHost(
base::WrapUnique(init_params.desktop_window_tree_host));
} else {
+ std::map<std::string, std::vector<uint8_t>> mus_properties =
msw 2016/11/21 19:26:47 Should this use the helper above?
sky 2016/11/21 22:13:56 Done.
+ init_params.mus_properties;
+ mus_properties[ui::mojom::WindowManager::kWindowType_Property] =
+ mojo::ConvertTo<std::vector<uint8_t>>(
+ static_cast<int32_t>(init_params.type));
native_widget->SetDesktopWindowTreeHost(
base::MakeUnique<DesktopWindowTreeHostMus>(delegate, native_widget,
- init_params));
+ &mus_properties));
}
return native_widget;
}

Powered by Google App Engine
This is Rietveld 408576698