Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / ui / views / view_targeter.h
blob84267273e3ad66713c4f8bb92a59cb4ef3c27020
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_VIEW_TARGETER_H_
6 #define UI_VIEWS_VIEW_TARGETER_H_
8 #include "ui/events/event_targeter.h"
9 #include "ui/views/views_export.h"
11 namespace views {
13 class View;
15 // Contains the logic used to determine the View to which an
16 // event should be dispatched. A ViewTargeter (or one of its
17 // derived classes) is installed on a View to specify the
18 // targeting behaviour to be used for the subtree rooted at
19 // that View.
20 class VIEWS_EXPORT ViewTargeter : public ui::EventTargeter {
21 public:
22 ViewTargeter();
23 virtual ~ViewTargeter();
25 protected:
26 // ui::EventTargeter:
27 virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root,
28 ui::Event* event) OVERRIDE;
29 virtual ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target,
30 ui::Event* event) OVERRIDE;
32 private:
33 View* FindTargetForKeyEvent(View* view, const ui::KeyEvent& key);
35 DISALLOW_COPY_AND_ASSIGN(ViewTargeter);
38 } // namespace views
40 #endif // UI_VIEWS_VIEW_TARGETER_H_