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

Unified Diff: ash/wm/ash_focus_rules.cc

Issue 11414252: Add focus rules for Ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « ash/wm/ash_focus_rules.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/ash_focus_rules.cc
===================================================================
--- ash/wm/ash_focus_rules.cc (revision 0)
+++ ash/wm/ash_focus_rules.cc (revision 0)
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 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 "ash/wm/ash_focus_rules.h"
+
+#include "ui/aura/window.h"
+
+namespace ash {
+namespace wm {
+
+////////////////////////////////////////////////////////////////////////////////
+// AshFocusRules, public:
+
+AshFocusRules::AshFocusRules() {
+}
+
+AshFocusRules::~AshFocusRules() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// AshFocusRules, views::corewm::FocusRules:
+
+bool AshFocusRules::CanActivateWindow(aura::Window* window) {
+ return !!window->parent();
+}
+
+bool AshFocusRules::CanFocusWindow(aura::Window* window) {
+ aura::Window* activatable = GetActivatableWindow(window);
+ return activatable->Contains(window) && window->CanFocus();
sadrul 2012/11/30 17:10:13 Can |activatable| (or |window|) be NULL?
+}
+
+aura::Window* AshFocusRules::GetActivatableWindow(aura::Window* window) {
+ return window;
+}
+
+aura::Window* AshFocusRules::GetFocusableWindow(aura::Window* window) {
+ return window;
+}
+
+aura::Window* AshFocusRules::GetNextActivatableWindow(aura::Window* ignore) {
+ return NULL;
+}
+
+aura::Window* AshFocusRules::GetNextFocusableWindow(aura::Window* ignore) {
+ return GetFocusableWindow(ignore->parent());
+}
+
+} // namespace wm
+} // namespace ash
« no previous file with comments | « ash/wm/ash_focus_rules.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698