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

Side by Side Diff: ui/views/controls/menu/menu_runner.h

Issue 331993009: MacViews: Run native Cocoa context menus to support Services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to master Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/controls/menu/menu_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // Returns the time from the event which closed the menu - or 0. 119 // Returns the time from the event which closed the menu - or 0.
120 base::TimeDelta closing_event_time() const; 120 base::TimeDelta closing_event_time() const;
121 121
122 private: 122 private:
123 friend class test::MenuRunnerTestAPI; 123 friend class test::MenuRunnerTestAPI;
124 124
125 // Sets an implementation of RunMenuAt. This is intended to be used at test. 125 // Sets an implementation of RunMenuAt. This is intended to be used at test.
126 void SetRunnerHandler(scoped_ptr<MenuRunnerHandler> runner_handler); 126 void SetRunnerHandler(scoped_ptr<MenuRunnerHandler> runner_handler);
127 127
128 const int32 run_types_; 128 const int32 run_types_;
129 scoped_ptr<MenuModelAdapter> menu_model_adapter_;
130 129
131 internal::MenuRunnerImpl* holder_; 130 // We own this. No scoped_ptr because it is destroyed by calling Release().
131 internal::MenuRunnerImplInterface* impl_;
132 132
133 // An implementation of RunMenuAt. This is usually NULL and ignored. If this 133 // An implementation of RunMenuAt. This is usually NULL and ignored. If this
134 // is not NULL, this implementation will be used. 134 // is not NULL, this implementation will be used.
135 scoped_ptr<MenuRunnerHandler> runner_handler_; 135 scoped_ptr<MenuRunnerHandler> runner_handler_;
136 136
137 scoped_ptr<internal::DisplayChangeListener> display_change_listener_; 137 scoped_ptr<internal::DisplayChangeListener> display_change_listener_;
138 138
139 DISALLOW_COPY_AND_ASSIGN(MenuRunner); 139 DISALLOW_COPY_AND_ASSIGN(MenuRunner);
140 }; 140 };
141 141
(...skipping 13 matching lines...) Expand all
155 155
156 protected: 156 protected:
157 DisplayChangeListener() {} 157 DisplayChangeListener() {}
158 }; 158 };
159 159
160 } // namespace internal 160 } // namespace internal
161 161
162 } // namespace views 162 } // namespace views
163 163
164 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ 164 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/controls/menu/menu_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698