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

Unified Diff: ui/views/controls/menu/menu_runner_impl_cocoa.h

Issue 2394123002: Views: Expose an on_closed callback via the MenuRunner constructor. (Closed)
Patch Set: default arg Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/menu/menu_runner_impl_cocoa.h
diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.h b/ui/views/controls/menu/menu_runner_impl_cocoa.h
index bb5f4b861dee6bac0197991b1ebe704c8378efa5..4b4184ca6459e08049203dac47da7a530b46471e 100644
--- a/ui/views/controls/menu/menu_runner_impl_cocoa.h
+++ b/ui/views/controls/menu/menu_runner_impl_cocoa.h
@@ -5,13 +5,13 @@
#ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_COCOA_H_
#define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_COCOA_H_
-#include "ui/views/controls/menu/menu_runner_impl_interface.h"
-
#include <stdint.h>
+#include "base/callback.h"
#import "base/mac/scoped_nsobject.h"
#include "base/macros.h"
#include "base/time/time.h"
+#include "ui/views/controls/menu/menu_runner_impl_interface.h"
@class MenuController;
@@ -21,7 +21,8 @@ namespace internal {
// A menu runner implementation that uses NSMenu to show a context menu.
class VIEWS_EXPORT MenuRunnerImplCocoa : public MenuRunnerImplInterface {
public:
- explicit MenuRunnerImplCocoa(ui::MenuModel* menu);
+ MenuRunnerImplCocoa(ui::MenuModel* menu,
+ const base::Closure& on_menu_closed_callback);
bool IsRunning() const override;
void Release() override;
@@ -48,6 +49,9 @@ class VIEWS_EXPORT MenuRunnerImplCocoa : public MenuRunnerImplInterface {
// The timestamp of the event which closed the menu - or 0.
base::TimeTicks closing_event_time_;
+ // Invoked before RunMenuAt() returns, except upon a Release().
+ base::Closure on_menu_closed_callback_;
+
DISALLOW_COPY_AND_ASSIGN(MenuRunnerImplCocoa);
};
« no previous file with comments | « ui/views/controls/menu/menu_runner_impl_adapter.cc ('k') | ui/views/controls/menu/menu_runner_impl_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698