diff options
Diffstat (limited to 'chrome/browser/ui/views')
3 files changed, 15 insertions, 13 deletions
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc index d5cd959..c76be14 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc @@ -62,8 +62,6 @@ void BookmarkMenuController::RunMenuAt(BookmarkBarView* bookmark_bar) { bounds, anchor, ui::MENU_SOURCE_NONE)); - if (!for_drop_) - delete this; } void BookmarkMenuController::Cancel() { @@ -140,10 +138,6 @@ bool BookmarkMenuController::ShowContextMenu(MenuItemView* source, return menu_delegate_->ShowContextMenu(source, id, p, source_type); } -void BookmarkMenuController::DropMenuClosed(MenuItemView* menu) { - delete this; -} - bool BookmarkMenuController::CanDrag(MenuItemView* menu) { return menu_delegate_->CanDrag(menu); } @@ -157,6 +151,11 @@ int BookmarkMenuController::GetDragOperations(MenuItemView* sender) { return menu_delegate_->GetDragOperations(sender); } +void BookmarkMenuController::OnMenuClosed(views::MenuItemView* menu, + views::MenuRunner::RunResult result) { + delete this; +} + views::MenuItemView* BookmarkMenuController::GetSiblingMenu( views::MenuItemView* menu, const gfx::Point& screen_point, diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h index c3a985a..995187e 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h @@ -101,11 +101,12 @@ class BookmarkMenuController : public bookmarks::BaseBookmarkModelObserver, int id, const gfx::Point& p, ui::MenuSourceType source_type) override; - void DropMenuClosed(views::MenuItemView* menu) override; bool CanDrag(views::MenuItemView* menu) override; void WriteDragData(views::MenuItemView* sender, ui::OSExchangeData* data) override; int GetDragOperations(views::MenuItemView* sender) override; + void OnMenuClosed(views::MenuItemView* menu, + views::MenuRunner::RunResult result) override; views::MenuItemView* GetSiblingMenu(views::MenuItemView* menu, const gfx::Point& screen_point, views::MenuAnchorPosition* anchor, diff --git a/chrome/browser/ui/views/toolbar/chevron_menu_button.cc b/chrome/browser/ui/views/toolbar/chevron_menu_button.cc index 69b207a..2e87277 100644 --- a/chrome/browser/ui/views/toolbar/chevron_menu_button.cc +++ b/chrome/browser/ui/views/toolbar/chevron_menu_button.cc @@ -95,7 +95,6 @@ class ChevronMenuButton::MenuController : public views::MenuDelegate { int id, const gfx::Point& p, ui::MenuSourceType source_type) override; - void DropMenuClosed(views::MenuItemView* menu) override; // These drag functions offer support for dragging icons into the overflow // menu. bool GetDropFormats( @@ -111,6 +110,8 @@ class ChevronMenuButton::MenuController : public views::MenuDelegate { int OnPerformDrop(views::MenuItemView* menu, DropPosition position, const ui::DropTargetEvent& event) override; + void OnMenuClosed(views::MenuItemView* menu, + views::MenuRunner::RunResult result) override; // These three drag functions offer support for dragging icons out of the // overflow menu. bool CanDrag(views::MenuItemView* menu) override; @@ -265,11 +266,6 @@ bool ChevronMenuButton::MenuController::ShowContextMenu( return true; } -void ChevronMenuButton::MenuController::DropMenuClosed( - views::MenuItemView* menu) { - owner_->MenuDone(); -} - bool ChevronMenuButton::MenuController::GetDropFormats( views::MenuItemView* menu, int* formats, @@ -336,6 +332,12 @@ int ChevronMenuButton::MenuController::OnPerformDrop( return ui::DragDropTypes::DRAG_MOVE; } +void ChevronMenuButton::MenuController::OnMenuClosed( + views::MenuItemView* menu, + views::MenuRunner::RunResult result) { + owner_->MenuDone(); +} + bool ChevronMenuButton::MenuController::CanDrag(views::MenuItemView* menu) { return true; } |