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

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

Issue 2578893003: Converts chrome to aura-mus (Closed)
Patch Set: merge again Created 4 years 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.h
diff --git a/ui/views/mus/mus_client.h b/ui/views/mus/mus_client.h
index a653f04e0d29e7b4393cc2fb44c3d7d5d1bb0b9d..ebb84df3e76eed24b0b1601cf7e1802cdf0fb514 100644
--- a/ui/views/mus/mus_client.h
+++ b/ui/views/mus/mus_client.h
@@ -58,17 +58,24 @@ class MusClientTestApi;
// MusClient establishes a connection to mus and sets up necessary state so that
// aura and views target mus. This class is useful for typical clients, not the
-// WindowManager. This class is created by AuraInit when
-// AuraInit::Mode::AURA_MUS is passed as the mode.
-// AuraInit::Mode::AURA to AuraInit and MusClient will be created for us.
+// WindowManager. Most clients don't create this directly, rather use
+// AuraInit.
class VIEWS_MUS_EXPORT MusClient
: public aura::WindowTreeClientDelegate,
public ScreenMusDelegate,
public ui::OSExchangeDataProviderFactory::Factory {
public:
+ // Most clients should use AuraInit, which creates a MusClient.
+ // |create_wm_state| indicates whether MusClient should create a wm::WMState.
+ MusClient(
+ service_manager::Connector* connector,
+ const service_manager::Identity& identity,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr,
+ bool create_wm_state = true);
~MusClient() override;
static MusClient* Get() { return instance_; }
+ static bool Exists() { return instance_ != nullptr; }
// Returns true if a DesktopNativeWidgetAura should be created given the
// specified params. If this returns false a NativeWidgetAura should be
@@ -88,6 +95,8 @@ class VIEWS_MUS_EXPORT MusClient
return pointer_watcher_event_router_.get();
}
+ ui::Gpu* gpu() { return gpu_.get(); }
+
// Creates DesktopNativeWidgetAura with DesktopWindowTreeHostMus. This is
// set as the factory function used for creating NativeWidgets when a
// NativeWidget has not been explicitly set.
@@ -101,11 +110,6 @@ class VIEWS_MUS_EXPORT MusClient
friend class AuraInit;
friend class test::MusClientTestApi;
- MusClient(
- service_manager::Connector* connector,
- const service_manager::Identity& identity,
- scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr);
-
// aura::WindowTreeClientDelegate:
void OnEmbed(
std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override;
@@ -130,6 +134,8 @@ class VIEWS_MUS_EXPORT MusClient
base::ObserverList<MusClientObserver> observer_list_;
+ // NOTE: this may be null (creation is based on argument supplied to
+ // constructor).
std::unique_ptr<wm::WMState> wm_state_;
std::unique_ptr<ScreenMus> screen_;

Powered by Google App Engine
This is Rietveld 408576698