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

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

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
« no previous file with comments | « ui/views/controls/menu/menu_item_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_item_view.cc
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index 15e7db39e64f632c32e0b4c4dd29f646515b5a0f..47d0b4e7521caa8d420f752179cfff20f39a66d2 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -110,6 +110,8 @@ MenuItemView::MenuItemView(MenuDelegate* delegate)
use_right_margin_(true) {
// NOTE: don't check the delegate for NULL, UpdateMenuPartSizes() supplies a
// NULL delegate.
+ // Note: This class also has a protected constructor and a common Init
+ // function to initialize both.
Finnur 2014/02/13 10:19:43 I was hoping to see this comment on line 91 (above
Init(NULL, 0, SUBMENU, delegate);
}
@@ -581,12 +583,16 @@ MenuItemView::MenuItemView(MenuItemView* parent,
requested_menu_position_(POSITION_BEST_FIT),
actual_menu_position_(requested_menu_position_),
use_right_margin_(true) {
+ // Note: This class also has a public constructor and a common Init function
+ // to initialize both.
Finnur 2014/02/13 10:19:43 Same here, move to line 564.
Init(parent, command, type, NULL);
}
MenuItemView::~MenuItemView() {
delete submenu_;
STLDeleteElements(&removed_items_);
+ if (lifecycle_observer_)
+ lifecycle_observer_->OnDeleted(this);
}
const char* MenuItemView::GetClassName() const {
@@ -641,6 +647,7 @@ void MenuItemView::Init(MenuItemView* parent,
// Assign our ID, this allows SubmenuItemView to find MenuItemViews.
set_id(kMenuItemViewID);
has_icons_ = false;
+ lifecycle_observer_ = NULL;
// Don't request enabled status from the root menu item as it is just
// a container for real items. EMPTY items will be disabled.
« no previous file with comments | « ui/views/controls/menu/menu_item_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698