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

Unified Diff: ash/common/wm_shell.h

Issue 2633293005: Converts mash to use Shell (Closed)
Patch Set: feedback Created 3 years, 11 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 | « ash/aura/wm_shell_aura.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_shell.h
diff --git a/ash/common/wm_shell.h b/ash/common/wm_shell.h
index ae07822cef817eaf1e236534248dbc1e84e4e14e..ade3b37bbd4571149e74ce3dd4a5884c8eee8f16 100644
--- a/ash/common/wm_shell.h
+++ b/ash/common/wm_shell.h
@@ -19,6 +19,7 @@
#include "components/ui_devtools/devtools_server.h"
#include "ui/base/ui_base_types.h"
#include "ui/compositor/layer_type.h"
+#include "ui/wm/public/activation_change_observer.h"
#include "ui/wm/public/window_types.h"
namespace app_list {
@@ -75,6 +76,7 @@ class ShelfDelegate;
class ShelfModel;
class ShelfWindowWatcher;
class ShellDelegate;
+struct ShellInitParams;
class ShellObserver;
class ShutdownController;
class SystemTrayDelegate;
@@ -102,15 +104,18 @@ class WindowState;
}
// Similar to ash::Shell. Eventually the two will be merged.
-class ASH_EXPORT WmShell : public SessionStateObserver {
+class ASH_EXPORT WmShell : public SessionStateObserver,
+ public aura::client::ActivationChangeObserver {
public:
+ ~WmShell() override;
+
// This is necessary for a handful of places that is difficult to plumb
// through context.
static void Set(WmShell* instance);
static WmShell* Get();
static bool HasInstance() { return instance_ != nullptr; }
- void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool);
+ virtual void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool);
virtual void Shutdown();
ShellDelegate* delegate() { return delegate_.get(); }
@@ -401,8 +406,8 @@ class ASH_EXPORT WmShell : public SessionStateObserver {
virtual SessionStateDelegate* GetSessionStateDelegate() = 0;
- virtual void AddActivationObserver(WmActivationObserver* observer) = 0;
- virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0;
+ void AddActivationObserver(WmActivationObserver* observer);
+ void RemoveActivationObserver(WmActivationObserver* observer);
virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0;
virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0;
@@ -444,9 +449,15 @@ class ASH_EXPORT WmShell : public SessionStateObserver {
// Enable or disable the laser pointer.
virtual void SetLaserPointerEnabled(bool enabled) = 0;
+ virtual void CreatePointerWatcherAdapter() = 0;
+
protected:
explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate);
- ~WmShell() override;
+
+ // Called during startup to create the primary WindowTreeHost and
+ // the corresponding RootWindowController.
+ virtual void CreatePrimaryHost() = 0;
+ virtual void InitHosts(const ShellInitParams& init_params) = 0;
base::ObserverList<ShellObserver>* shell_observers() {
return &shell_observers_;
@@ -483,6 +494,13 @@ class ASH_EXPORT WmShell : public SessionStateObserver {
friend class Shell;
friend class WmShellTestApi;
+ // aura::client::ActivationChangeObserver:
+ void OnWindowActivated(ActivationReason reason,
+ aura::Window* gained_active,
+ aura::Window* lost_active) override;
+ void OnAttemptToReactivateWindow(aura::Window* request_active,
+ aura::Window* actual_active) override;
+
static WmShell* instance_;
base::ObserverList<ShellObserver> shell_observers_;
@@ -531,6 +549,9 @@ class ASH_EXPORT WmShell : public SessionStateObserver {
bool simulate_modal_window_open_for_testing_ = false;
+ bool added_activation_observer_ = false;
+ base::ObserverList<WmActivationObserver> activation_observers_;
+
scoped_refptr<base::SequencedWorkerPool> blocking_pool_;
};
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698