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

Unified Diff: ui/aura/env.h

Issue 2488723002: Reland of Improves focus/activation for aura-mus and DesktopNativeWidgetAura (Closed)
Patch Set: Created 4 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 | « ui/aura/client/focus_client.cc ('k') | ui/aura/env.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.h
diff --git a/ui/aura/env.h b/ui/aura/env.h
index d557a1f50f54d8f82d6276feaa940d017d1fb135..acd289b4c580e829932698ef9f9716ac5129edaf 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -21,6 +21,10 @@
class PlatformEventSource;
}
namespace aura {
+
+namespace client {
+class FocusClient;
+}
namespace test {
class EnvTestHelper;
@@ -74,7 +78,17 @@
}
ui::ContextFactory* context_factory() { return context_factory_; }
+ // Sets the active FocusClient and the window the FocusClient is associated
+ // with. |window| is not necessarily the window that actually has focus.
+ // |window| may be null, which indicates all windows share a FocusClient.
+ void SetActiveFocusClient(client::FocusClient* focus_client,
+ Window* focus_client_root);
+ client::FocusClient* active_focus_client() { return active_focus_client_; }
+ Window* active_focus_client_root() { return active_focus_client_root_; }
+
private:
+ class ActiveFocusClientWindowObserver;
+
friend class test::EnvTestHelper;
friend class Window;
friend class WindowTreeHost;
@@ -91,6 +105,8 @@
// Invoked by WindowTreeHost when it is activated. Notifies observers.
void NotifyHostActivated(WindowTreeHost* host);
+
+ void OnActiveFocusClientWindowDestroying();
// Overridden from ui::EventTarget:
bool CanAcceptEvent(const ui::Event& event) override;
@@ -112,6 +128,11 @@
ui::ContextFactory* context_factory_;
+ Window* active_focus_client_root_ = nullptr;
+ client::FocusClient* active_focus_client_ = nullptr;
+ std::unique_ptr<ActiveFocusClientWindowObserver>
+ active_focus_client_window_observer_;
+
DISALLOW_COPY_AND_ASSIGN(Env);
};
« no previous file with comments | « ui/aura/client/focus_client.cc ('k') | ui/aura/env.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698