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

Unified Diff: ui/views/focus/focus_manager_delegate.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 | « ui/views/focus/focus_manager.cc ('k') | ui/views/focus/focus_manager_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/focus/focus_manager_delegate.h
diff --git a/ui/views/focus/focus_manager_delegate.h b/ui/views/focus/focus_manager_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..1763ed26c35315f89a98bba4e15de385b3cee353
--- /dev/null
+++ b/ui/views/focus/focus_manager_delegate.h
@@ -0,0 +1,40 @@
+// 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 UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_
+#define UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_
+#pragma once
+
+#include "ui/views/views_export.h"
+
+namespace ui {
+class Accelerator;
+class AcceleratorTarget;
+}
+
+namespace views {
+
+// Delegate interface for views::FocusManager.
+class VIEWS_EXPORT FocusManagerDelegate {
+ public:
+ virtual ~FocusManagerDelegate() {}
+
+ // Activate the target associated with the specified accelerator.
+ // First, AcceleratorPressed handler of the most recently registered target
+ // is called, and if that handler processes the event (i.e. returns true),
+ // this method immediately returns. If not, we do the same thing on the next
+ // target, and so on.
+ // Returns true if an accelerator was activated.
+ virtual bool ProcessAccelerator(const ui::Accelerator& accelerator) = 0;
+
+ // Returns the AcceleratorTarget that should be activated for the specified
+ // keyboard accelerator, or NULL if no view is registered for that keyboard
+ // accelerator.
+ virtual ui::AcceleratorTarget* GetCurrentTargetForAccelerator(
+ const ui::Accelerator& accelerator) const = 0;
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_DELEGATE_H_
« no previous file with comments | « ui/views/focus/focus_manager.cc ('k') | ui/views/focus/focus_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698