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

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

Issue 10446090: Changes the tabstrip dragging code to use coordinates from the events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/tab_strip.h ('k') | chrome/browser/ui/views/tabs/tab_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 626805ed06334fe7b6188a71a1a5b8cd6bdb129f..d3c178e021a9d68e9e79d27ff6b985591c5a1df2 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -985,9 +985,12 @@ void TabStrip::MaybeStartDrag(
selection_model, detach_behavior, move_behavior);
}
-void TabStrip::ContinueDrag(const views::MouseEvent& event) {
- if (drag_controller_.get())
- drag_controller_->Drag();
+void TabStrip::ContinueDrag(views::View* view, const gfx::Point& location) {
+ if (drag_controller_.get()) {
+ gfx::Point screen_location(location);
+ views::View::ConvertPointToScreen(view, &screen_location);
+ drag_controller_->Drag(screen_location);
+ }
}
bool TabStrip::EndDrag(bool canceled) {
@@ -1310,9 +1313,8 @@ bool TabStrip::OnMousePressed(const views::MouseEvent& event) {
return false;
}
-bool TabStrip::OnMouseDragged(const views::MouseEvent& event) {
- if (drag_controller_.get())
- drag_controller_->Drag();
+bool TabStrip::OnMouseDragged(const views::MouseEvent& event) {
+ ContinueDrag(this, event.location());
return true;
}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/tabs/tab_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698