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

Unified Diff: ui/views/mus/mus_client.cc

Issue 2480273003: Revert 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/views/mus/mus_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/mus_client.cc
diff --git a/ui/views/mus/mus_client.cc b/ui/views/mus/mus_client.cc
index 6a3a9d5dde05a8713ef19d54a293c3cef35bc88a..4add5a07cccb915d616d62c46cce58d9dd5861d7 100644
--- a/ui/views/mus/mus_client.cc
+++ b/ui/views/mus/mus_client.cc
@@ -24,11 +24,29 @@
#include "ui/views/mus/surface_context_factory.h"
#include "ui/views/views_delegate.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
+#include "ui/wm/core/base_focus_rules.h"
#include "ui/wm/core/capture_controller.h"
+#include "ui/wm/core/focus_controller.h"
#include "ui/wm/core/wm_state.h"
namespace views {
namespace {
+
+// TODO: this is temporary, figure out what the real one should be like.
+class FocusRulesMus : public wm::BaseFocusRules {
+ public:
+ FocusRulesMus() {}
+ ~FocusRulesMus() override {}
+
+ // wm::BaseFocusRules::
+ bool SupportsChildActivation(aura::Window* window) const override {
+ NOTIMPLEMENTED();
+ return true;
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FocusRulesMus);
+};
class PropertyConverterImpl : public aura::PropertyConverter {
public:
@@ -113,6 +131,8 @@
base::MakeUnique<views::SurfaceContextFactory>(gpu_service_.get());
aura::Env::GetInstance()->set_context_factory(
compositor_context_factory_.get());
+ // TODO(sky): need a class similar to DesktopFocusRules.
+ focus_controller_ = base::MakeUnique<wm::FocusController>(new FocusRulesMus);
window_tree_client_ =
base::MakeUnique<aura::WindowTreeClient>(this, nullptr, nullptr);
window_tree_client_->ConnectViaWindowTreeFactory(connector_);
@@ -154,6 +174,10 @@
void MusClient::OnWindowManagerFrameValuesChanged() {
// TODO(sky): wire up to DesktopNativeWidgetAura.
NOTIMPLEMENTED();
+}
+
+aura::client::FocusClient* MusClient::GetFocusClient() {
+ return focus_controller_.get();
}
aura::client::CaptureClient* MusClient::GetCaptureClient() {
« no previous file with comments | « ui/views/mus/mus_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698