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

Unified Diff: ash/common/wm_shell.h

Issue 2115663002: Folds methods in WmShellCommon to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 6 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/common/wm/window_positioner.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 881a6080610e495b9f3fa0a412ac49ffc5b0b560..8189231fae53de545c08df3ab0ecaab36ed3fe2a 100644
--- a/ash/common/wm_shell.h
+++ b/ash/common/wm_shell.h
@@ -13,6 +13,7 @@
#include "ash/ash_export.h"
#include "ash/common/media_delegate.h"
#include "ash/common/metrics/user_metrics_action.h"
+#include "base/observer_list.h"
namespace gfx {
class Rect;
@@ -62,6 +63,8 @@ class ASH_EXPORT WmShell {
KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
+ MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
+
MediaDelegate* media_delegate() { return media_delegate_.get(); }
SystemTrayNotifier* system_tray_notifier() {
@@ -76,8 +79,6 @@ class ASH_EXPORT WmShell {
return window_selector_controller_.get();
}
- virtual MruWindowTracker* GetMruWindowTracker() = 0;
-
// Creates a new window used as a container of other windows. No painting is
// done to the created window.
virtual WmWindow* NewContainerWindow() = 0;
@@ -155,6 +156,11 @@ class ASH_EXPORT WmShell {
// Called after overview mode has ended.
virtual void OnOverviewModeEnded() = 0;
+ // Notifies |observers_| when entering or exiting pinned mode for
+ // |pinned_window|. Entering or exiting can be checked by looking at
+ // |pinned_window|'s window state.
+ void NotifyPinnedStateChanged(WmWindow* pinned_window);
+
virtual AccessibilityDelegate* GetAccessibilityDelegate() = 0;
virtual SessionStateDelegate* GetSessionStateDelegate() = 0;
@@ -165,8 +171,8 @@ class ASH_EXPORT WmShell {
virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0;
virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0;
- virtual void AddShellObserver(ShellObserver* observer) = 0;
- virtual void RemoveShellObserver(ShellObserver* observer) = 0;
+ void AddShellObserver(ShellObserver* observer);
+ void RemoveShellObserver(ShellObserver* observer);
virtual void AddPointerWatcher(views::PointerWatcher* watcher) = 0;
virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0;
@@ -184,6 +190,10 @@ class ASH_EXPORT WmShell {
WmShell();
virtual ~WmShell();
+ base::ObserverList<ShellObserver>* shell_observers() {
+ return &shell_observers_;
+ }
+
void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui);
// Helpers to set (and initialize) or destroy various delegates.
@@ -194,14 +204,20 @@ class ASH_EXPORT WmShell {
void DeleteWindowSelectorController();
+ void CreateMruWindowTracker();
+ void DeleteMruWindowTracker();
+
private:
friend class Shell;
static WmShell* instance_;
+ base::ObserverList<ShellObserver> shell_observers_;
+
std::unique_ptr<FocusCycler> focus_cycler_;
std::unique_ptr<KeyboardUI> keyboard_ui_;
std::unique_ptr<MediaDelegate> media_delegate_;
+ std::unique_ptr<MruWindowTracker> mru_window_tracker_;
std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
std::unique_ptr<WindowSelectorController> window_selector_controller_;
« no previous file with comments | « ash/common/wm/window_positioner.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698