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

Unified Diff: chrome/browser/chrome_browser_main_extra_parts_exo.cc

Issue 2778733004: Add WindowPinType property on arua::Window (Closed)
Patch Set: Address review issues 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
Index: chrome/browser/chrome_browser_main_extra_parts_exo.cc
diff --git a/chrome/browser/chrome_browser_main_extra_parts_exo.cc b/chrome/browser/chrome_browser_main_extra_parts_exo.cc
index f955c0a7ffe7e004b8d13ba5f91f440ae819a87d..927a81664b528d2e4a5b52fc6dda4f2ea3017f5c 100644
--- a/chrome/browser/chrome_browser_main_extra_parts_exo.cc
+++ b/chrome/browser/chrome_browser_main_extra_parts_exo.cc
@@ -10,6 +10,7 @@
#include <glib.h>
#endif
+#include "ash/public/cpp/window_properties.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
@@ -21,6 +22,8 @@
#include "components/exo/wm_helper_mus.h"
#include "content/public/browser/browser_thread.h"
#include "ui/arc/notification/arc_notification_surface_manager.h"
+#include "ui/aura/mus/property_converter.h"
+#include "ui/views/mus/mus_client.h"
#if defined(USE_GLIB)
namespace {
@@ -117,6 +120,23 @@ ChromeBrowserMainExtraPartsExo::ChromeBrowserMainExtraPartsExo() {}
ChromeBrowserMainExtraPartsExo::~ChromeBrowserMainExtraPartsExo() {}
+void ChromeBrowserMainExtraPartsExo::ServiceManagerConnectionStarted(
+ content::ServiceManagerConnection* connection) {
+ if (ash_util::IsRunningInMash()) {
+ // Register exo-specific window properties with Chrome's property converter.
+ // This propagates ash properties set on exo windows to ash, via mojo.
+ DCHECK(views::MusClient::Exists());
+ views::MusClient* mus_client = views::MusClient::Get();
+ aura::WindowTreeClientDelegate* delegate = mus_client;
+ aura::PropertyConverter* converter = delegate->GetPropertyConverter();
+
+ converter->RegisterProperty(
sky 2017/03/31 20:54:47 Are you sure you don't need to use the MusProperty
Peng 2017/04/03 15:11:27 I added it in ash/public/cpp/mus_property_mirror_a
+ ash::kWindowPinTypeKey,
+ ui::mojom::WindowManager::kWindowPinType_Property,
+ base::Bind(&ash::IsValidWindowPinType));
+ }
+}
+
void ChromeBrowserMainExtraPartsExo::PreProfileInit() {
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableWaylandServer))

Powered by Google App Engine
This is Rietveld 408576698