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

Unified Diff: chrome/browser/ui/views/tabs/base_tab.cc

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refinements, etc. Created 9 years, 9 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: chrome/browser/ui/views/tabs/base_tab.cc
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index cef7d9c4a2b5838cb4b3a038e2f76fae7ab8e974..87290ed25bb518ad108131a3a7877d3e602a2178 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -315,7 +315,7 @@ bool BaseTab::OnMouseDragged(const views::MouseEvent& event) {
return true;
}
-void BaseTab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
+void BaseTab::OnMouseReleased(const views::MouseEvent& event) {
if (!controller())
return;
@@ -324,7 +324,7 @@ void BaseTab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
// In some cases, ending the drag will schedule the tab for destruction; if
// so, bail immediately, since our members are already dead and we shouldn't
// do anything else except drop the tab where it is.
- if (controller()->EndDrag(canceled))
+ if (controller()->EndDrag(false))
return;
// Close tab on middle click, but only if the button is released over the tab
@@ -352,6 +352,11 @@ void BaseTab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
}
}
+void BaseTab::OnMouseCaptureLost() {
+ if (controller())
+ controller()->EndDrag(true);
+}
+
void BaseTab::OnMouseEntered(const views::MouseEvent& event) {
if (!hover_animation_.get()) {
hover_animation_.reset(new ui::SlideAnimation(this));

Powered by Google App Engine
This is Rietveld 408576698