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

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

Issue 2714763002: Change FocusSynchronizer to maintain active focus client and window. (Closed)
Patch Set: switch back to use FocusSynchronizerObserver Created 3 years, 9 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
Index: ui/aura/mus/focus_synchronizer_observer.h
diff --git a/ui/aura/mus/focus_synchronizer_observer.h b/ui/aura/mus/focus_synchronizer_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..34d30b0724d1b86c4dff3787e29d05330afe44b0
--- /dev/null
+++ b/ui/aura/mus/focus_synchronizer_observer.h
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_AURA_MUS_FOCUS_SYNCHRONIZER_OBSERVER_H_
+#define UI_AURA_MUS_FOCUS_SYNCHRONIZER_OBSERVER_H_
+
+#include "ui/aura/aura_export.h"
+
+namespace aura {
+class Window;
+
+namespace client {
+class FocusClient;
+}
+
+// FocusSynchronizerObserver gets notified when the active focus client and the
+// window it's associated with (active focus client root) maintained by
+// FocusSynchronizer changed. To get notified when the actual focused window
+// gets changed, use FocusChangeObserver instead.
+class AURA_EXPORT FocusSynchronizerObserver {
+ public:
+ // Called from FocusSynchronizer::SetActiveFocusClient() to notify its
+ // observers of active focus client and active focus client root changes.
+ virtual void OnActiveFocusClientChanged(client::FocusClient* focus_client,
+ Window* focus_client_root) {}
+
+ protected:
+ virtual ~FocusSynchronizerObserver() {}
sadrul 2017/03/28 15:03:23 I think this can just be public
riajiang 2017/03/28 22:07:27 But the current pattern of other observer classes
sadrul 2017/03/29 16:13:19 Yes. I can't think of a good reason for doing this
riajiang 2017/03/29 17:27:35 I think I'll keep it here to be consistent for now
+};
+
+} // namespace aura
+
+#endif // UI_AURA_MUS_FOCUS_SYNCHRONIZER_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698