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

Unified Diff: mojo/services/window_manager/basic_focus_rules.h

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 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
« no previous file with comments | « mojo/services/window_manager/DEPS ('k') | mojo/services/window_manager/basic_focus_rules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/window_manager/basic_focus_rules.h
diff --git a/mojo/services/window_manager/basic_focus_rules.h b/mojo/services/window_manager/basic_focus_rules.h
new file mode 100644
index 0000000000000000000000000000000000000000..d14a9b0dcaea2cda40c400f6fecedb8f61f619c8
--- /dev/null
+++ b/mojo/services/window_manager/basic_focus_rules.h
@@ -0,0 +1,49 @@
+// Copyright 2014 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 SERVICES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_
+#define SERVICES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_
+
+#include "mojo/services/window_manager/focus_rules.h"
+
+namespace mojo {
+class View;
+}
+
+namespace window_manager {
+
+// The focusing rules used inside a window manager.
+//
+// This is intended to be a user supplyable, subclassable component passed to
+// WindowManagerApp, allowing for the creation of other window managers.
+class BasicFocusRules : public FocusRules {
+ public:
+ BasicFocusRules(mojo::View* window_container);
+ ~BasicFocusRules() override;
+
+ protected:
+ // Overridden from mojo::FocusRules:
+ bool SupportsChildActivation(mojo::View* view) const override;
+ bool IsToplevelView(mojo::View* view) const override;
+ bool CanActivateView(mojo::View* view) const override;
+ bool CanFocusView(mojo::View* view) const override;
+ mojo::View* GetToplevelView(mojo::View* view) const override;
+ mojo::View* GetActivatableView(mojo::View* view) const override;
+ mojo::View* GetFocusableView(mojo::View* view) const override;
+ mojo::View* GetNextActivatableView(mojo::View* activatable) const override;
+
+ private:
+ bool CanFocusViewImpl(mojo::View* view) const;
+
+ // Tests to see if |view| is in |window_container_|.
+ bool IsViewParentedToWindowContainer(mojo::View* view) const;
+
+ mojo::View* window_container_;
+
+ DISALLOW_COPY_AND_ASSIGN(BasicFocusRules);
+};
+
+} // namespace window_manager
+
+#endif // SERVICES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_
« no previous file with comments | « mojo/services/window_manager/DEPS ('k') | mojo/services/window_manager/basic_focus_rules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698