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

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

Issue 1543173002: Switch to standard integer types in ui/views/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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 <stdint.h>
9
9 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
11 #include "ui/base/ui_base_types.h" 13 #include "ui/base/ui_base_types.h"
12 #include "ui/views/controls/menu/menu_types.h" 14 #include "ui/views/controls/menu/menu_types.h"
13 #include "ui/views/views_export.h" 15 #include "ui/views/views_export.h"
14 16
15 namespace base { 17 namespace base {
16 class TimeDelta; 18 class TimeDelta;
17 } 19 }
18 20
19 namespace gfx { 21 namespace gfx {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 enum RunResult { 99 enum RunResult {
98 // Indicates RunMenuAt is returning because the MenuRunner was deleted. 100 // Indicates RunMenuAt is returning because the MenuRunner was deleted.
99 MENU_DELETED, 101 MENU_DELETED,
100 102
101 // Indicates RunMenuAt returned and MenuRunner was not deleted. 103 // Indicates RunMenuAt returned and MenuRunner was not deleted.
102 NORMAL_EXIT 104 NORMAL_EXIT
103 }; 105 };
104 106
105 // Creates a new MenuRunner. 107 // Creates a new MenuRunner.
106 // |run_types| is a bitmask of RunTypes. 108 // |run_types| is a bitmask of RunTypes.
107 MenuRunner(ui::MenuModel* menu_model, int32 run_types); 109 MenuRunner(ui::MenuModel* menu_model, int32_t run_types);
108 MenuRunner(MenuItemView* menu, int32 run_types); 110 MenuRunner(MenuItemView* menu, int32_t run_types);
109 ~MenuRunner(); 111 ~MenuRunner();
110 112
111 // Runs the menu. If this returns MENU_DELETED the method is returning 113 // Runs the menu. If this returns MENU_DELETED the method is returning
112 // because the MenuRunner was deleted. 114 // because the MenuRunner was deleted.
113 // Typically callers should NOT do any processing if this returns 115 // Typically callers should NOT do any processing if this returns
114 // MENU_DELETED. 116 // MENU_DELETED.
115 // If |anchor| uses a |BUBBLE_..| type, the bounds will get determined by 117 // If |anchor| uses a |BUBBLE_..| type, the bounds will get determined by
116 // using |bounds| as the thing to point at in screen coordinates. 118 // using |bounds| as the thing to point at in screen coordinates.
117 RunResult RunMenuAt(Widget* parent, 119 RunResult RunMenuAt(Widget* parent,
118 MenuButton* button, 120 MenuButton* button,
119 const gfx::Rect& bounds, 121 const gfx::Rect& bounds,
120 MenuAnchorPosition anchor, 122 MenuAnchorPosition anchor,
121 ui::MenuSourceType source_type) WARN_UNUSED_RESULT; 123 ui::MenuSourceType source_type) WARN_UNUSED_RESULT;
122 124
123 // Returns true if we're in a nested message loop running the menu. 125 // Returns true if we're in a nested message loop running the menu.
124 bool IsRunning() const; 126 bool IsRunning() const;
125 127
126 // Hides and cancels the menu. This does nothing if the menu is not open. 128 // Hides and cancels the menu. This does nothing if the menu is not open.
127 void Cancel(); 129 void Cancel();
128 130
129 // Returns the time from the event which closed the menu - or 0. 131 // Returns the time from the event which closed the menu - or 0.
130 base::TimeDelta closing_event_time() const; 132 base::TimeDelta closing_event_time() const;
131 133
132 private: 134 private:
133 friend class test::MenuRunnerTestAPI; 135 friend class test::MenuRunnerTestAPI;
134 136
135 // Sets an implementation of RunMenuAt. This is intended to be used at test. 137 // Sets an implementation of RunMenuAt. This is intended to be used at test.
136 void SetRunnerHandler(scoped_ptr<MenuRunnerHandler> runner_handler); 138 void SetRunnerHandler(scoped_ptr<MenuRunnerHandler> runner_handler);
137 139
138 const int32 run_types_; 140 const int32_t run_types_;
139 141
140 // We own this. No scoped_ptr because it is destroyed by calling Release(). 142 // We own this. No scoped_ptr because it is destroyed by calling Release().
141 internal::MenuRunnerImplInterface* impl_; 143 internal::MenuRunnerImplInterface* impl_;
142 144
143 // An implementation of RunMenuAt. This is usually NULL and ignored. If this 145 // An implementation of RunMenuAt. This is usually NULL and ignored. If this
144 // is not NULL, this implementation will be used. 146 // is not NULL, this implementation will be used.
145 scoped_ptr<MenuRunnerHandler> runner_handler_; 147 scoped_ptr<MenuRunnerHandler> runner_handler_;
146 148
147 scoped_ptr<internal::DisplayChangeListener> display_change_listener_; 149 scoped_ptr<internal::DisplayChangeListener> display_change_listener_;
148 150
(...skipping 16 matching lines...) Expand all
165 167
166 protected: 168 protected:
167 DisplayChangeListener() {} 169 DisplayChangeListener() {}
168 }; 170 };
169 171
170 } // namespace internal 172 } // namespace internal
171 173
172 } // namespace views 174 } // namespace views
173 175
174 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ 176 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698