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

Unified Diff: ash/accelerators/focus_manager_factory.h

Issue 10134036: Let Chrome app handle Ash accelerators first if the app is launched as a window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final rebase Created 8 years, 7 months 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/accelerators/accelerator_filter_unittest.cc ('k') | ash/accelerators/focus_manager_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/focus_manager_factory.h
diff --git a/ash/accelerators/focus_manager_factory.h b/ash/accelerators/focus_manager_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..8469ff9692948f2d206386c933f86bb34cb117a9
--- /dev/null
+++ b/ash/accelerators/focus_manager_factory.h
@@ -0,0 +1,43 @@
+// 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_ACCELERATORS_FOCUS_MANAGER_FACTORY_H_
+#define ASH_ACCELERATORS_FOCUS_MANAGER_FACTORY_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "ui/views/focus/focus_manager_delegate.h"
+#include "ui/views/focus/focus_manager_factory.h"
+
+namespace ash {
+
+// A factory class for creating a custom views::FocusManager object which
+// supports Ash shortcuts.
+class AshFocusManagerFactory : public views::FocusManagerFactory {
+ public:
+ AshFocusManagerFactory();
+ virtual ~AshFocusManagerFactory();
+
+ protected:
+ // views::FocusManagerFactory overrides:
+ virtual views::FocusManager* CreateFocusManager(
+ views::Widget* widget) OVERRIDE;
+
+ private:
+ class Delegate : public views::FocusManagerDelegate {
+ public:
+ // views::FocusManagerDelegate overrides:
+ virtual bool ProcessAccelerator(
+ const ui::Accelerator& accelerator) OVERRIDE;
+ virtual ui::AcceleratorTarget* GetCurrentTargetForAccelerator(
+ const ui::Accelerator& accelerator) const OVERRIDE;
+ };
+
+ DISALLOW_COPY_AND_ASSIGN(AshFocusManagerFactory);
+};
+
+} // namespace ash
+
+#endif // ASH_ACCELERATORS_FOCUS_MANAGER_FACTORY_H_
« no previous file with comments | « ash/accelerators/accelerator_filter_unittest.cc ('k') | ash/accelerators/focus_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698