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

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

Issue 148143004: Add notification mechanism when BrowserActionButton's icon has been updated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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_item_view.h
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
index bb1ae266193a1711073eb113c23ce63bf089a8b2..dd6b936907e2a526617652f1f05644361d4178d1 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -61,6 +61,18 @@ class SubmenuView;
class VIEWS_EXPORT MenuItemView : public View {
public:
+ // The LifecycleObserver will receive a notification when the MenuItemView has
+ // been deleted.
+ class LifecycleObserver {
+ public:
+ virtual ~LifecycleObserver() {}
+ virtual void OnDeleted(MenuItemView* view) = 0;
+ };
+
+ void set_lifecycle_observer(LifecycleObserver* lifecycle_observer) {
+ lifecycle_observer_ = lifecycle_observer;
+ }
+
friend class MenuController;
// The menu item view's class name.
@@ -526,6 +538,10 @@ class VIEWS_EXPORT MenuItemView : public View {
// containing other elements.
bool use_right_margin_;
+ // The observer that we need to notify when the menu item view has been
+ // deleted.
+ LifecycleObserver* lifecycle_observer_;
+
DISALLOW_COPY_AND_ASSIGN(MenuItemView);
};

Powered by Google App Engine
This is Rietveld 408576698