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

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: Address comments, fix tests, cleanup, 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
« no previous file with comments | « chrome/browser/ui/views/tabs/base_tab.h ('k') | chrome/browser/ui/views/tabs/base_tab_strip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4810411996329924eb6df73a94182e0b4acef645..81a7262ed9e0faddb8262bb99a8c878534e631bf 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -311,7 +311,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;
@@ -320,7 +320,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
@@ -347,6 +347,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));
« no previous file with comments | « chrome/browser/ui/views/tabs/base_tab.h ('k') | chrome/browser/ui/views/tabs/base_tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698