| OLD | NEW |
| (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_ |
| OLD | NEW |