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

Unified Diff: components/mus/ws/focus_controller.h

Issue 1459463004: mus: Allow the WM to specify the windows that can have active children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 5 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
« no previous file with comments | « components/mus/ws/BUILD.gn ('k') | components/mus/ws/focus_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/focus_controller.h
diff --git a/components/mus/ws/focus_controller.h b/components/mus/ws/focus_controller.h
index 8567f63c1055a3cf13e064f7ac8a9390e557f56e..0b1894efcf28da966488f544c227b44e3ae4be05 100644
--- a/components/mus/ws/focus_controller.h
+++ b/components/mus/ws/focus_controller.h
@@ -13,6 +13,7 @@ namespace mus {
namespace ws {
+class FocusControllerDelegate;
class FocusControllerObserver;
class ServerWindow;
class ServerWindowDrawnTracker;
@@ -27,7 +28,7 @@ enum class FocusControllerChangeSource {
// state of the focused window changes.
class FocusController : public ServerWindowDrawnTrackerObserver {
public:
- FocusController();
+ explicit FocusController(FocusControllerDelegate* delegate);
~FocusController() override;
// Sets the focused window. Does nothing if |window| is currently focused.
@@ -35,9 +36,6 @@ class FocusController : public ServerWindowDrawnTrackerObserver {
void SetFocusedWindow(ServerWindow* window);
ServerWindow* GetFocusedWindow();
- // Moves activation to the next activatable window.
- void CycleActivationForward();
-
void AddObserver(FocusControllerObserver* observer);
void RemoveObserver(FocusControllerObserver* observer);
@@ -46,6 +44,10 @@ class FocusController : public ServerWindowDrawnTrackerObserver {
bool CanBeFocused(ServerWindow* window) const;
bool CanBeActivated(ServerWindow* window) const;
+ // Returns the closest activatable ancestor of |window|. Returns nullptr if
+ // there is no such ancestor.
+ ServerWindow* GetActivatableAncestorOf(ServerWindow* window) const;
+
// Implementation of SetFocusedWindow().
void SetFocusedWindowImpl(FocusControllerChangeSource change_source,
ServerWindow* window);
@@ -55,7 +57,14 @@ class FocusController : public ServerWindowDrawnTrackerObserver {
ServerWindow* window,
bool is_drawn) override;
+ FocusControllerDelegate* delegate_;
+
+ ServerWindow* focused_window_;
+ ServerWindow* active_window_;
+
base::ObserverList<FocusControllerObserver> observers_;
+
+ // Keeps track of the visibility of the focused and active window.
scoped_ptr<ServerWindowDrawnTracker> drawn_tracker_;
DISALLOW_COPY_AND_ASSIGN(FocusController);
« no previous file with comments | « components/mus/ws/BUILD.gn ('k') | components/mus/ws/focus_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698