summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/menu_tracked_root_view.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/menu_tracked_root_view.h')
-rw-r--r--chrome/browser/cocoa/menu_tracked_root_view.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/menu_tracked_root_view.h b/chrome/browser/cocoa/menu_tracked_root_view.h
new file mode 100644
index 0000000..6d4bffa
--- /dev/null
+++ b/chrome/browser/cocoa/menu_tracked_root_view.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_MENU_TRACKED_ROOT_VIEW_H_
+#define CHROME_BROWSER_COCOA_MENU_TRACKED_ROOT_VIEW_H_
+#pragma once
+
+#import <Cocoa/Cocoa.h>
+
+// An instance of MenuTrackedRootView should be the root of the view hierarchy
+// of the custom view of NSMenuItems. If the user opens the menu in a non-
+// sticky fashion (i.e. clicks, holds, and drags) and then releases the mouse
+// over the menu item, it will cancel tracking on the |[menuItem_ menu]|.
+@interface MenuTrackedRootView : NSView {
+ @private
+ // The menu item whose custom view's root view is an instance of this class.
+ NSMenuItem* menuItem_; // weak
+}
+
+@property (assign, nonatomic) NSMenuItem* menuItem;
+
+@end
+
+#endif // CHROME_BROWSER_COCOA_MENU_TRACKED_ROOT_VIEW_H_