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

Unified Diff: services/window_manager/basic_focus_rules.h

Issue 747163002: Port more focus controller unit tests and fix our focus rules. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Remove O(n) solution with O(1). Created 6 years 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/tools/data/unittests ('k') | 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: services/window_manager/basic_focus_rules.h
diff --git a/services/window_manager/basic_focus_rules.h b/services/window_manager/basic_focus_rules.h
index 670d78acb4a739793b9b3df43d3ffb8c2f9b0bd8..6802cacbb36ad5064d8c408cbfab597d679fbcfc 100644
--- a/services/window_manager/basic_focus_rules.h
+++ b/services/window_manager/basic_focus_rules.h
@@ -15,10 +15,6 @@ class View;
//
// This is intended to be a user supplyable, subclassable component passed to
// WindowManagerApp, allowing for the creation of other window managers.
-//
-// TODO(erg): This was a straight move of the minimal focus rules from when
-// WindowManagerApp directly used the wm::FocusController. This implementation
-// is very incomplete. crbug.com/431047
class BasicFocusRules : public FocusRules {
public:
BasicFocusRules(mojo::View* window_container);
@@ -26,6 +22,7 @@ class BasicFocusRules : public FocusRules {
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;
@@ -35,6 +32,11 @@ class BasicFocusRules : public FocusRules {
mojo::View* GetNextActivatableView(mojo::View* activatable) const override;
private:
+ bool CanFocusViewImpl(View* view) const;
+
+ // Tests to see if |view| is in |window_container_|.
+ bool IsViewParentedToWindowContainer(View* view) const;
+
mojo::View* window_container_;
DISALLOW_COPY_AND_ASSIGN(BasicFocusRules);
« no previous file with comments | « mojo/tools/data/unittests ('k') | services/window_manager/basic_focus_rules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698