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

Side by Side Diff: ui/views/widget/widget_accelerator_handling_delegate.h

Issue 2604793002: Allow Widget to pass accelerator handling to its parent.
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 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.
4
5 #ifndef UI_VIEWS_WIDGET_WIDGET_ACCELERATOR_HANDLING_DELEGATE_H_
6 #define UI_VIEWS_WIDGET_WIDGET_ACCELERATOR_HANDLING_DELEGATE_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "base/scoped_observer.h"
10 #include "ui/views/widget/widget_observer.h"
11
12 namespace views {
13
14 class FocusManagerDelegate;
15
16 class WidgetAcceleratorHandlingDelegate : public WidgetObserver {
17 public:
18 explicit WidgetAcceleratorHandlingDelegate(Widget* accelerator_target);
19 ~WidgetAcceleratorHandlingDelegate() override;
20
21 Widget* accelerator_target() const { return accelerator_target_; }
22
23 base::WeakPtr<WidgetAcceleratorHandlingDelegate> GetWeakPtr();
24
25 std::unique_ptr<FocusManagerDelegate> CreateFocusManagerDelegate();
26
27 // Implements WidgetObserver:
28 void OnWidgetDestroying(Widget* widget) override;
29
30 private:
31 Widget* accelerator_target_;
32 ScopedObserver<Widget, WidgetAcceleratorHandlingDelegate>
33 accelerator_target_observer_;
34
35 base::WeakPtrFactory<WidgetAcceleratorHandlingDelegate> weak_factory_;
36
37 DISALLOW_COPY_AND_ASSIGN(WidgetAcceleratorHandlingDelegate);
38 };
39
40 } // namespace views
41
42 #endif // UI_VIEWS_WIDGET_WIDGET_ACCELERATOR_HANDLING_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698