summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 20:28:27 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 20:28:27 +0000
commitfc42c509410d4bf004c7dff02ad1a8835c3146b5 (patch)
tree12e5a9ee662bf2ab1b5bed4396c50c6d13820161 /ash
parent7459680f3cd9978f17e0e3f0b0ad28ba206b31ce (diff)
downloadchromium_src-fc42c509410d4bf004c7dff02ad1a8835c3146b5.zip
chromium_src-fc42c509410d4bf004c7dff02ad1a8835c3146b5.tar.gz
chromium_src-fc42c509410d4bf004c7dff02ad1a8835c3146b5.tar.bz2
Ensure that keystrokes sent to desktop chrome AURA don't make their way into accelerator handling in ASH.
ASH registers a focus manager factory which creates focus managers for top level widgets with a FocusManager::Delegate interface implementation which is used to process accelerators. We allow only one focus manager factory to exist at any given time, which means that the focus manager factory for ASH gets notified for subsequent focus manager creation requests, some of them from the desktop. This results in keystrokes for desktop widgets making their way to the ASH focus manager delegate. Fix is to pass in a bool flag desktop_widget in the NativeWidgetDelegate::OnNativeWidgetCreated method which is implemented by the Widget class. This flag when true causes the ASH focus manager to default to the default focus manager behavior, which is to create focus managers with a NULL delegate. BUG=246821 R=sky@chromium.org Review URL: https://codereview.chromium.org/15882009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/accelerators/focus_manager_factory.cc5
-rw-r--r--ash/accelerators/focus_manager_factory.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/ash/accelerators/focus_manager_factory.cc b/ash/accelerators/focus_manager_factory.cc
index 76dcd9f..0695fd3 100644
--- a/ash/accelerators/focus_manager_factory.cc
+++ b/ash/accelerators/focus_manager_factory.cc
@@ -14,8 +14,9 @@ AshFocusManagerFactory::AshFocusManagerFactory() {}
AshFocusManagerFactory::~AshFocusManagerFactory() {}
views::FocusManager* AshFocusManagerFactory::CreateFocusManager(
- views::Widget* widget) {
- return new views::FocusManager(widget, new Delegate);
+ views::Widget* widget,
+ bool desktop_widget) {
+ return new views::FocusManager(widget, desktop_widget ? NULL : new Delegate);
}
bool AshFocusManagerFactory::Delegate::ProcessAccelerator(
diff --git a/ash/accelerators/focus_manager_factory.h b/ash/accelerators/focus_manager_factory.h
index aa9f4b4..cbe27cb 100644
--- a/ash/accelerators/focus_manager_factory.h
+++ b/ash/accelerators/focus_manager_factory.h
@@ -22,7 +22,8 @@ class AshFocusManagerFactory : public views::FocusManagerFactory {
protected:
// views::FocusManagerFactory overrides:
virtual views::FocusManager* CreateFocusManager(
- views::Widget* widget) OVERRIDE;
+ views::Widget* widget,
+ bool desktop_widget) OVERRIDE;
private:
class Delegate : public views::FocusManagerDelegate {