Commit dc4863be authored by ben@chromium.org's avatar ben@chromium.org

Add focus rules for Ash. They are empty for now. I will begin migrating code...

Add focus rules for Ash. They are empty for now. I will begin migrating code over from ActivationController once I have a flag to turn this on.

http://crbug.com/162100
R=sky@chromium.org
Review URL: https://codereview.chromium.org/11414252

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170479 0039d316-1c4b-4281-b951-d872f2087c98
parent 24afae3c
...@@ -273,6 +273,8 @@ ...@@ -273,6 +273,8 @@
'wm/always_on_top_controller.h', 'wm/always_on_top_controller.h',
'wm/ash_activation_controller.cc', 'wm/ash_activation_controller.cc',
'wm/ash_activation_controller.h', 'wm/ash_activation_controller.h',
'wm/ash_focus_rules.cc',
'wm/ash_focus_rules.h',
'wm/base_layout_manager.cc', 'wm/base_layout_manager.cc',
'wm/base_layout_manager.h', 'wm/base_layout_manager.h',
'wm/boot_splash_screen.cc', 'wm/boot_splash_screen.cc',
......
// 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();
}
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
// 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.
#ifndef ASH_WM_ASH_FOCUS_RULES_H_
#define ASH_WM_ASH_FOCUS_RULES_H_
#include "ash/ash_export.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/views/corewm/focus_rules.h"
namespace ash {
namespace wm {
class ASH_EXPORT AshFocusRules : public views::corewm::FocusRules {
public:
AshFocusRules();
virtual ~AshFocusRules();
private:
// Overridden from views::corewm::FocusRules:
virtual bool CanActivateWindow(aura::Window* window) OVERRIDE;
virtual bool CanFocusWindow(aura::Window* window) OVERRIDE;
virtual aura::Window* GetActivatableWindow(aura::Window* window) OVERRIDE;
virtual aura::Window* GetFocusableWindow(aura::Window* window) OVERRIDE;
virtual aura::Window* GetNextActivatableWindow(aura::Window* ignore) OVERRIDE;
virtual aura::Window* GetNextFocusableWindow(aura::Window* ignore) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(AshFocusRules);
};
} // namespace wm
} // namespace ash
#endif // ASH_WM_ASH_FOCUS_RULES_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment