Index: chrome/browser/ui/views/toolbar/browser_actions_container.cc |
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc |
index df22b9b3287323a545827a4cc5ff7cdd3e768826..57aff05e5cf0437185da07fc29ae4233a606bd5e 100644 |
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc |
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc |
@@ -265,6 +265,15 @@ bool BrowserActionsContainer::ShownInsideMenu() const { |
return in_overflow_mode(); |
} |
+void BrowserActionsContainer::OnBrowserActionViewDragDone() { |
+ // We notify here as well as in OnPerformDrop because the dragged view is |
+ // removed in OnPerformDrop, so it will never get its OnDragDone() call. |
+ // TODO(devlin) we should see about fixing that. |
Finnur
2014/07/18 10:40:40
nit: Missing colon after end-parenthesis.
Devlin
2014/07/18 15:44:32
Done.
|
+ FOR_EACH_OBSERVER(BrowserActionsContainerObserver, |
+ observers_, |
+ OnBrowserActionDragDone()); |
+} |
+ |
void BrowserActionsContainer::AddObserver( |
BrowserActionsContainerObserver* observer) { |
observers_.AddObserver(observer); |
@@ -373,18 +382,15 @@ void BrowserActionsContainer::Layout() { |
bool BrowserActionsContainer::GetDropFormats( |
int* formats, |
std::set<OSExchangeData::CustomFormat>* custom_formats) { |
- custom_formats->insert(BrowserActionDragData::GetBrowserActionCustomFormat()); |
- |
- return true; |
+ return BrowserActionDragData::GetDropFormats(custom_formats); |
} |
bool BrowserActionsContainer::AreDropTypesRequired() { |
- return true; |
+ return BrowserActionDragData::AreDropTypesRequired(); |
} |
bool BrowserActionsContainer::CanDrop(const OSExchangeData& data) { |
- BrowserActionDragData drop_data; |
- return drop_data.Read(data) ? drop_data.IsFromProfile(profile_) : false; |
+ return BrowserActionDragData::CanDrop(data, profile_); |
} |
void BrowserActionsContainer::OnDragEntered( |
@@ -499,6 +505,9 @@ int BrowserActionsContainer::OnPerformDrop( |
browser_action_views_[data.index()]->button()->extension(), i); |
OnDragExited(); // Perform clean up after dragging. |
+ FOR_EACH_OBSERVER(BrowserActionsContainerObserver, |
+ observers_, |
+ OnBrowserActionDragDone()); |
return ui::DragDropTypes::DRAG_MOVE; |
} |