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

Unified Diff: views/controls/menu/menu_controller_delegate.h

Issue 7720012: Moves ownership of MenuItemView to MenuRunner as well as responbility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 9 years, 4 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: views/controls/menu/menu_controller_delegate.h
diff --git a/views/controls/menu/menu_controller_delegate.h b/views/controls/menu/menu_controller_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..db6857915a63f63f52242470c873a4f4c587699c
--- /dev/null
+++ b/views/controls/menu/menu_controller_delegate.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 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 VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_
+#define VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_
+#pragma once
+
+namespace views {
+
+class MenuItemView;
+
+// This is internal as there should be no need for usage of this class outside
+// of views.
+namespace internal {
+
+// Used by MenuController to notify of interesting events that are intended for
+// the class using MenuController. This is implemented by MenuRunnerImpl.
+class MenuControllerDelegate {
+ public:
+ enum NotifyType {
+ NOTIFY_DELEGATE,
+ DONT_NOTIFY_DELEGATE
+ };
+
+ // Invoked when MenuController closes a menu and the MenuController was
+ // configured for drop (MenuRunner::FOR_DROP).
+ virtual void DropMenuClosed(NotifyType type, MenuItemView* menu) = 0;
+
+ // Invoked when the MenuDelegate::GetSiblingMenu() returns non-NULL.
+ virtual void SiblingMenuCreated(MenuItemView* menu) = 0;
+
+ protected:
+ virtual ~MenuControllerDelegate() {}
+};
+
+} // namespace internal
+
+} // namespace view
+
+#endif // VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698