| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace views { | 27 namespace views { |
| 28 | 28 |
| 29 class MenuButton; | 29 class MenuButton; |
| 30 class MenuItemView; | 30 class MenuItemView; |
| 31 class MenuModelAdapter; | 31 class MenuModelAdapter; |
| 32 class MenuRunnerHandler; | 32 class MenuRunnerHandler; |
| 33 class Widget; | 33 class Widget; |
| 34 | 34 |
| 35 namespace internal { | 35 namespace internal { |
| 36 class DisplayChangeListener; | 36 class DisplayChangeListener; |
| 37 class MenuRunnerImpl; | 37 class MenuRunnerImplInterface; |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace test { | 40 namespace test { |
| 41 class MenuRunnerTestAPI; | 41 class MenuRunnerTestAPI; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // MenuRunner is responsible for showing (running) the menu and additionally | 44 // MenuRunner is responsible for showing (running) the menu and additionally |
| 45 // owning the MenuItemView. RunMenuAt() runs a nested message loop. It is safe | 45 // owning the MenuItemView. RunMenuAt() runs a nested message loop. It is safe |
| 46 // to delete MenuRunner at any point, but MenuRunner internally only deletes the | 46 // to delete MenuRunner at any point, but MenuRunner internally only deletes the |
| 47 // MenuItemView *after* the nested message loop completes. If MenuRunner is | 47 // MenuItemView *after* the nested message loop completes. If MenuRunner is |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Returns the time from the event which closed the menu - or 0. | 127 // Returns the time from the event which closed the menu - or 0. |
| 128 base::TimeDelta closing_event_time() const; | 128 base::TimeDelta closing_event_time() const; |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 friend class test::MenuRunnerTestAPI; | 131 friend class test::MenuRunnerTestAPI; |
| 132 | 132 |
| 133 // Sets an implementation of RunMenuAt. This is intended to be used at test. | 133 // Sets an implementation of RunMenuAt. This is intended to be used at test. |
| 134 void SetRunnerHandler(scoped_ptr<MenuRunnerHandler> runner_handler); | 134 void SetRunnerHandler(scoped_ptr<MenuRunnerHandler> runner_handler); |
| 135 | 135 |
| 136 const int32 run_types_; | 136 const int32 run_types_; |
| 137 scoped_ptr<MenuModelAdapter> menu_model_adapter_; | |
| 138 | 137 |
| 139 internal::MenuRunnerImpl* holder_; | 138 // We own this. No scoped_ptr because it is destroyed by calling Release(). |
| 139 internal::MenuRunnerImplInterface* impl_; |
| 140 | 140 |
| 141 // An implementation of RunMenuAt. This is usually NULL and ignored. If this | 141 // An implementation of RunMenuAt. This is usually NULL and ignored. If this |
| 142 // is not NULL, this implementation will be used. | 142 // is not NULL, this implementation will be used. |
| 143 scoped_ptr<MenuRunnerHandler> runner_handler_; | 143 scoped_ptr<MenuRunnerHandler> runner_handler_; |
| 144 | 144 |
| 145 scoped_ptr<internal::DisplayChangeListener> display_change_listener_; | 145 scoped_ptr<internal::DisplayChangeListener> display_change_listener_; |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(MenuRunner); | 147 DISALLOW_COPY_AND_ASSIGN(MenuRunner); |
| 148 }; | 148 }; |
| 149 | 149 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 163 | 163 |
| 164 protected: | 164 protected: |
| 165 DisplayChangeListener() {} | 165 DisplayChangeListener() {} |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 } // namespace internal | 168 } // namespace internal |
| 169 | 169 |
| 170 } // namespace views | 170 } // namespace views |
| 171 | 171 |
| 172 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ | 172 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
| OLD | NEW |