| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Given a MenuModel, adapts MenuRunnerImpl which expects a MenuItemView. | 22 // Given a MenuModel, adapts MenuRunnerImpl which expects a MenuItemView. |
| 23 class VIEWS_EXPORT MenuRunnerImplAdapter | 23 class VIEWS_EXPORT MenuRunnerImplAdapter |
| 24 : public NON_EXPORTED_BASE(MenuRunnerImplInterface) { | 24 : public NON_EXPORTED_BASE(MenuRunnerImplInterface) { |
| 25 public: | 25 public: |
| 26 MenuRunnerImplAdapter(ui::MenuModel* menu_model, | 26 MenuRunnerImplAdapter(ui::MenuModel* menu_model, |
| 27 const base::Closure& on_menu_closed_callback); | 27 const base::Closure& on_menu_closed_callback); |
| 28 | 28 |
| 29 // MenuRunnerImplInterface: | 29 // MenuRunnerImplInterface: |
| 30 bool IsRunning() const override; | 30 bool IsRunning() const override; |
| 31 void Release() override; | 31 void Release() override; |
| 32 MenuRunner::RunResult RunMenuAt(Widget* parent, | 32 void RunMenuAt(Widget* parent, |
| 33 MenuButton* button, | 33 MenuButton* button, |
| 34 const gfx::Rect& bounds, | 34 const gfx::Rect& bounds, |
| 35 MenuAnchorPosition anchor, | 35 MenuAnchorPosition anchor, |
| 36 int32_t types) override; | 36 int32_t types) override; |
| 37 void Cancel() override; | 37 void Cancel() override; |
| 38 base::TimeTicks GetClosingEventTime() const override; | 38 base::TimeTicks GetClosingEventTime() const override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 ~MenuRunnerImplAdapter() override; | 41 ~MenuRunnerImplAdapter() override; |
| 42 | 42 |
| 43 std::unique_ptr<MenuModelAdapter> menu_model_adapter_; | 43 std::unique_ptr<MenuModelAdapter> menu_model_adapter_; |
| 44 MenuRunnerImpl* impl_; | 44 MenuRunnerImpl* impl_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(MenuRunnerImplAdapter); | 46 DISALLOW_COPY_AND_ASSIGN(MenuRunnerImplAdapter); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace internal | 49 } // namespace internal |
| 50 } // namespace views | 50 } // namespace views |
| 51 | 51 |
| 52 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_ | 52 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_ |
| OLD | NEW |