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

Unified Diff: ui/aura/mus/focus_synchronizer.h

Issue 2843193002: chromeos: fix focus for mushrome (Closed)
Patch Set: feedback Created 3 years, 8 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 | « ui/aura/BUILD.gn ('k') | ui/aura/mus/focus_synchronizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/focus_synchronizer.h
diff --git a/ui/aura/mus/focus_synchronizer.h b/ui/aura/mus/focus_synchronizer.h
index cca9ebaf2e7a0a78b7ddd445f3f40f5c230e89b7..b2908cb7ce92fd54b188e95840a0025e20ce7136 100644
--- a/ui/aura/mus/focus_synchronizer.h
+++ b/ui/aura/mus/focus_synchronizer.h
@@ -28,7 +28,12 @@ class FocusClient;
}
// FocusSynchronizer is resonsible for keeping focus in sync between aura
-// and the mus server.
+// and the mus server. FocusSynchronizer may be configured in two distinct
+// ways:
+// . SetSingletonFocusClient(). Use this when a single FocusClient is shared
+// among all windows and never changes.
+// . SetActiveFocusClient(). Use this when there may be more than one
+// FocusClient.
class AURA_EXPORT FocusSynchronizer : public client::FocusChangeObserver,
public WindowObserver {
public:
@@ -51,6 +56,11 @@ class AURA_EXPORT FocusSynchronizer : public client::FocusChangeObserver,
// Called when the focused window is destroyed.
void OnFocusedWindowDestroyed();
+ // Used when the focus client is shared among all windows. See class
+ // description for details.
+ void SetSingletonFocusClient(client::FocusClient* focus_client);
+ bool is_singleton_focus_client() const { return is_singleton_focus_client_; }
+
// Sets the active FocusClient and the window the FocusClient is associated
// with. |focus_client_root| is not necessarily the window that actually has
// focus.
@@ -86,6 +96,8 @@ class AURA_EXPORT FocusSynchronizer : public client::FocusChangeObserver,
bool setting_focus_ = false;
WindowMus* window_setting_focus_to_ = nullptr;
+ bool is_singleton_focus_client_ = false;
+
client::FocusClient* active_focus_client_ = nullptr;
// The window that |active_focus_client_| is associated with.
Window* active_focus_client_root_ = nullptr;
« no previous file with comments | « ui/aura/BUILD.gn ('k') | ui/aura/mus/focus_synchronizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698