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

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

Issue 718573002: Revert "Remove aura and make a pure mojo::View version of the aura::Window FocusController." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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 | « mojo/services/window_manager/basic_focus_rules.h ('k') | mojo/services/window_manager/focus_controller.h » ('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.cc
diff --git a/mojo/services/window_manager/basic_focus_rules.cc b/mojo/services/window_manager/basic_focus_rules.cc
deleted file mode 100644
index 95496a10be372747e8537d81c8e758e89c721e4c..0000000000000000000000000000000000000000
--- a/mojo/services/window_manager/basic_focus_rules.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// 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.
-
-#include "mojo/services/window_manager/basic_focus_rules.h"
-
-#include "base/macros.h"
-#include "mojo/services/public/cpp/view_manager/view.h"
-#include "mojo/services/window_manager/window_manager_app.h"
-
-namespace mojo {
-
-BasicFocusRules::BasicFocusRules(mojo::WindowManagerApp* window_manager_app,
- mojo::View* window_container)
- : window_container_(window_container),
- window_manager_app_(window_manager_app) {}
-
-BasicFocusRules::~BasicFocusRules() {}
-
-bool BasicFocusRules::IsToplevelView(mojo::View* view) const {
- return view->parent() == window_container_;
-}
-
-bool BasicFocusRules::CanActivateView(mojo::View* view) const {
- // TODO(erg): This needs to check visibility, along with focus, and several
- // other things (see wm::BaseFocusRules).
- return view->parent() == window_container_;
-}
-
-bool BasicFocusRules::CanFocusView(mojo::View* view) const {
- return true;
-}
-
-mojo::View* BasicFocusRules::GetToplevelView(mojo::View* view) const {
- while (view->parent() != window_container_) {
- view = view->parent();
- // Unparented hierarchy, there is no "top level" window.
- if (!view)
- return nullptr;
- }
-
- return view;
-}
-
-mojo::View* BasicFocusRules::GetActivatableView(mojo::View* view) const {
- return GetToplevelView(view);
-}
-
-mojo::View* BasicFocusRules::GetFocusableView(mojo::View* view) const {
- return view;
-}
-
-mojo::View* BasicFocusRules::GetNextActivatableView(
- mojo::View* activatable) const {
- const mojo::View::Children& children = activatable->parent()->children();
- for (mojo::View::Children::const_reverse_iterator it = children.rbegin();
- it != children.rend(); ++it) {
- if (*it != activatable)
- return *it;
- }
- return nullptr;
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/services/window_manager/basic_focus_rules.h ('k') | mojo/services/window_manager/focus_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698