diff options
-rw-r--r-- | ash/screen_ash.h | 6 | ||||
-rw-r--r-- | ash/wm/toplevel_window_event_filter.cc | 15 | ||||
-rw-r--r-- | ash/wm/toplevel_window_event_filter.h | 2 | ||||
-rw-r--r-- | ash/wm/workspace/multi_window_resize_controller.cc | 74 | ||||
-rw-r--r-- | ash/wm/workspace/multi_window_resize_controller.h | 25 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_event_filter.cc | 4 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_event_filter.h | 7 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_window_resizer.cc | 4 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_window_resizer.h | 2 | ||||
-rw-r--r-- | chrome/browser/ui/ash/tabs/dock_info_ash.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/views/tabs/tab_drag_controller.cc | 161 | ||||
-rw-r--r-- | chrome/browser/ui/views/tabs/tab_drag_controller.h | 48 |
12 files changed, 185 insertions, 171 deletions
diff --git a/ash/screen_ash.h b/ash/screen_ash.h index d150d4b..8c57322 100644 --- a/ash/screen_ash.h +++ b/ash/screen_ash.h @@ -7,10 +7,12 @@ #include "ash/ash_export.h" #include "base/compiler_specific.h" -#include "ui/gfx/insets.h" -#include "ui/gfx/rect.h" #include "ui/gfx/screen_impl.h" +namespace gfx { +class Rect; +} + namespace ash { // Aura implementation of gfx::Screen. Implemented here to avoid circular diff --git a/ash/wm/toplevel_window_event_filter.cc b/ash/wm/toplevel_window_event_filter.cc index c950036..8d0ee8d 100644 --- a/ash/wm/toplevel_window_event_filter.cc +++ b/ash/wm/toplevel_window_event_filter.cc @@ -80,10 +80,10 @@ bool ToplevelWindowEventFilter::PreHandleMouseEvent(aura::Window* target, if ((event->flags() & (ui::EF_IS_DOUBLE_CLICK | ui::EF_IS_TRIPLE_CLICK)) == 0 && WindowResizer::GetBoundsChangeForWindowComponent(component)) { - gfx::Point parent_location( + gfx::Point location_in_parent( ConvertPointToParent(target, event->location())); window_resizer_.reset( - CreateWindowResizer(target, parent_location, component)); + CreateWindowResizer(target, location_in_parent, component)); } else { window_resizer_.reset(); } @@ -136,10 +136,10 @@ ui::GestureStatus ToplevelWindowEventFilter::PreHandleGestureEvent( return ui::GESTURE_STATUS_UNKNOWN; } in_gesture_resize_ = true; - gfx::Point parent_location( + gfx::Point location_in_parent( ConvertPointToParent(target, event->location())); window_resizer_.reset( - CreateWindowResizer(target, parent_location, component)); + CreateWindowResizer(target, location_in_parent, component)); break; } case ui::ET_GESTURE_SCROLL_UPDATE: { @@ -209,7 +209,7 @@ void ToplevelWindowEventFilter::RunMoveLoop(aura::Window* source) { GetLastTouchPointForTarget(source, &drag_location); DCHECK(has_point); } else { - drag_location = gfx::Screen::GetCursorScreenPoint(); + drag_location = root_window->GetLastMouseLocationInRoot(); aura::Window::ConvertPointToWindow( root_window, source->parent(), &drag_location); } @@ -241,11 +241,12 @@ void ToplevelWindowEventFilter::EndMoveLoop() { // static WindowResizer* ToplevelWindowEventFilter::CreateWindowResizer( aura::Window* window, - const gfx::Point& point, + const gfx::Point& point_in_parent, int window_component) { if (!wm::IsWindowNormal(window)) return NULL; // Don't allow resizing/dragging maximized/fullscreen windows. - return DefaultWindowResizer::Create(window, point, window_component); + return DefaultWindowResizer::Create( + window, point_in_parent, window_component); } void ToplevelWindowEventFilter::CompleteDrag(DragCompletionStatus status, diff --git a/ash/wm/toplevel_window_event_filter.h b/ash/wm/toplevel_window_event_filter.h index 4d33994..4576432 100644 --- a/ash/wm/toplevel_window_event_filter.h +++ b/ash/wm/toplevel_window_event_filter.h @@ -57,7 +57,7 @@ class ASH_EXPORT ToplevelWindowEventFilter : protected: // Creates a new WindowResizer. virtual WindowResizer* CreateWindowResizer(aura::Window* window, - const gfx::Point& point, + const gfx::Point& point_in_parent, int window_component); private: diff --git a/ash/wm/workspace/multi_window_resize_controller.cc b/ash/wm/workspace/multi_window_resize_controller.cc index a94da55..aa23b16 100644 --- a/ash/wm/workspace/multi_window_resize_controller.cc +++ b/ash/wm/workspace/multi_window_resize_controller.cc @@ -4,12 +4,14 @@ #include "ash/wm/workspace/multi_window_resize_controller.h" +#include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/wm/window_animations.h" #include "ash/wm/workspace/workspace_event_filter.h" #include "ash/wm/workspace/workspace_window_resizer.h" #include "grit/ui_resources.h" +#include "ui/aura/client/screen_position_client.h" #include "ui/aura/event_filter.h" #include "ui/aura/root_window.h" #include "ui/aura/shared/compound_event_filter.h" @@ -118,9 +120,9 @@ class MultiWindowResizeController::ResizeMouseWatcherHost : ResizeMouseWatcherHost(MultiWindowResizeController* host) : host_(host) {} // MouseWatcherHost overrides: - virtual bool Contains(const gfx::Point& screen_point, + virtual bool Contains(const gfx::Point& point_in_screen, MouseEventType type) OVERRIDE { - return host_->IsOverWindows(screen_point); + return host_->IsOverWindows(point_in_screen); } private: @@ -156,7 +158,7 @@ MultiWindowResizeController::~MultiWindowResizeController() { void MultiWindowResizeController::Show(Window* window, int component, - const gfx::Point& point) { + const gfx::Point& point_in_window) { // When the resize widget is showing we ignore Show() requests. Instead we // only care about mouse movements from MouseWatcher. This is necessary as // WorkspaceEventFilter only sees mouse movements over the windows, not all @@ -164,7 +166,7 @@ void MultiWindowResizeController::Show(Window* window, if (resize_widget_) return; - ResizeWindows windows(DetermineWindows(window, component, point)); + ResizeWindows windows(DetermineWindows(window, component, point_in_window)); if (IsShowing()) { if (windows_.Equals(windows)) return; // Over the same windows. @@ -177,8 +179,9 @@ void MultiWindowResizeController::Show(Window* window, windows_ = windows; windows_.window1->AddObserver(this); windows_.window2->AddObserver(this); - show_location_ = point; - Window::ConvertPointToWindow(window, window->parent(), &show_location_); + show_location_in_parent_ = point_in_window; + Window::ConvertPointToWindow( + window, window->parent(), &show_location_in_parent_); if (show_timer_.IsRunning()) return; show_timer_.Start(FROM_HERE, @@ -369,8 +372,10 @@ void MultiWindowResizeController::ShowNow() { WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController"); resize_widget_->SetContentsView(view); - show_bounds_ = CalculateResizeWidgetBounds(show_location_); - resize_widget_->SetBounds(show_bounds_); + show_bounds_in_screen_ = ScreenAsh::ConvertRectToScreen( + windows_.window1->parent(), + CalculateResizeWidgetBounds(show_location_in_parent_)); + resize_widget_->SetBounds(show_bounds_in_screen_); resize_widget_->Show(); mouse_watcher_.reset(new views::MouseWatcher( new ResizeMouseWatcherHost(this), @@ -385,14 +390,13 @@ bool MultiWindowResizeController::IsShowing() const { } void MultiWindowResizeController::StartResize( - const gfx::Point& screen_location) { + const gfx::Point& location_in_screen) { DCHECK(!window_resizer_.get()); DCHECK(windows_.is_valid()); hide_timer_.Stop(); - gfx::Point parent_location(screen_location); - aura::Window::ConvertPointToWindow( - windows_.window1->GetRootWindow(), windows_.window1->parent(), - &parent_location); + gfx::Point location_in_parent(location_in_screen); + aura::client::GetScreenPositionClient(windows_.window2->GetRootWindow())-> + ConvertPointFromScreen(windows_.window2->parent(), &location_in_parent); std::vector<aura::Window*> windows; windows.push_back(windows_.window2); FindWindowsTouching(windows_.window2, windows_.direction, @@ -403,21 +407,23 @@ void MultiWindowResizeController::StartResize( } int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM; window_resizer_.reset(WorkspaceWindowResizer::Create( - windows_.window1, parent_location, component, windows)); + windows_.window1, location_in_parent, component, windows)); } -void MultiWindowResizeController::Resize(const gfx::Point& screen_location, +void MultiWindowResizeController::Resize(const gfx::Point& location_in_screen, int event_flags) { - gfx::Point parent_location(screen_location); - aura::Window::ConvertPointToWindow(windows_.window1->GetRootWindow(), - windows_.window1->parent(), - &parent_location); - window_resizer_->Drag(parent_location, event_flags); - gfx::Rect bounds = CalculateResizeWidgetBounds(parent_location); + gfx::Point location_in_parent(location_in_screen); + aura::client::GetScreenPositionClient(windows_.window1->GetRootWindow())-> + ConvertPointFromScreen(windows_.window1->parent(), &location_in_parent); + window_resizer_->Drag(location_in_parent, event_flags); + gfx::Rect bounds = ScreenAsh::ConvertRectToScreen( + windows_.window1->parent(), + CalculateResizeWidgetBounds(location_in_parent)); + if (windows_.direction == LEFT_RIGHT) - bounds.set_y(show_bounds_.y()); + bounds.set_y(show_bounds_in_screen_.y()); else - bounds.set_x(show_bounds_.x()); + bounds.set_x(show_bounds_in_screen_.x()); resize_widget_->SetBounds(bounds); } @@ -440,21 +446,21 @@ void MultiWindowResizeController::CancelResize() { } gfx::Rect MultiWindowResizeController::CalculateResizeWidgetBounds( - const gfx::Point& location) const { + const gfx::Point& location_in_parent) const { gfx::Size pref = resize_widget_->GetContentsView()->GetPreferredSize(); int x = 0, y = 0; if (windows_.direction == LEFT_RIGHT) { x = windows_.window1->bounds().right() - pref.width() / 2; - y = location.y() + kResizeWidgetPadding; + y = location_in_parent.y() + kResizeWidgetPadding; if (y + pref.height() / 2 > windows_.window1->bounds().bottom() && y + pref.height() / 2 > windows_.window2->bounds().bottom()) { - y = location.y() - kResizeWidgetPadding - pref.height(); + y = location_in_parent.y() - kResizeWidgetPadding - pref.height(); } } else { - x = location.x() + kResizeWidgetPadding; + x = location_in_parent.x() + kResizeWidgetPadding; if (x + pref.height() / 2 > windows_.window1->bounds().right() && x + pref.height() / 2 > windows_.window2->bounds().right()) { - x = location.x() - kResizeWidgetPadding - pref.width(); + x = location_in_parent.x() - kResizeWidgetPadding - pref.width(); } y = windows_.window1->bounds().bottom() - pref.height() / 2; } @@ -462,11 +468,11 @@ gfx::Rect MultiWindowResizeController::CalculateResizeWidgetBounds( } bool MultiWindowResizeController::IsOverWindows( - const gfx::Point& screen_location) const { + const gfx::Point& location_in_screen) const { if (window_resizer_.get()) return true; // Ignore hides while actively resizing. - if (resize_widget_->GetWindowBoundsInScreen().Contains(screen_location)) + if (resize_widget_->GetWindowBoundsInScreen().Contains(location_in_screen)) return true; int hit1, hit2; @@ -478,18 +484,18 @@ bool MultiWindowResizeController::IsOverWindows( hit2 = HTLEFT; } - return IsOverWindow(windows_.window1, screen_location, hit1) || - IsOverWindow(windows_.window2, screen_location, hit2); + return IsOverWindow(windows_.window1, location_in_screen, hit1) || + IsOverWindow(windows_.window2, location_in_screen, hit2); } bool MultiWindowResizeController::IsOverWindow( aura::Window* window, - const gfx::Point& screen_location, + const gfx::Point& location_in_screen, int component) const { if (!window->delegate()) return false; - gfx::Point window_loc(screen_location); + gfx::Point window_loc(location_in_screen); aura::Window::ConvertPointToWindow( window->GetRootWindow(), window, &window_loc); return window->HitTest(window_loc) && diff --git a/ash/wm/workspace/multi_window_resize_controller.h b/ash/wm/workspace/multi_window_resize_controller.h index f14e15a..1fb4b62 100644 --- a/ash/wm/workspace/multi_window_resize_controller.h +++ b/ash/wm/workspace/multi_window_resize_controller.h @@ -122,10 +122,10 @@ class ASH_EXPORT MultiWindowResizeController : bool IsShowing() const; // Initiates a resize. - void StartResize(const gfx::Point& screen_location); + void StartResize(const gfx::Point& location_in_screen); // Resizes to the new location. - void Resize(const gfx::Point& screen_location, int event_flags); + void Resize(const gfx::Point& location_in_screen, int event_flags); // Completes the resize. void CompleteResize(int event_flags); @@ -134,15 +134,16 @@ class ASH_EXPORT MultiWindowResizeController : void CancelResize(); // Returns the bounds for the resize widget. - gfx::Rect CalculateResizeWidgetBounds(const gfx::Point& location) const; + gfx::Rect CalculateResizeWidgetBounds( + const gfx::Point& location_in_parent) const; - // Returns true if |screen_location| is over the resize windows (or the resize - // widget itself). - bool IsOverWindows(const gfx::Point& screen_location) const; + // Returns true if |location_in_screen| is over the resize windows + // (or the resize widget itself). + bool IsOverWindows(const gfx::Point& location_in_screen) const; - // Returns true if |screen_location| is over |window|. + // Returns true if |location_in_screen| is over |window|. bool IsOverWindow(aura::Window* window, - const gfx::Point& screen_location, + const gfx::Point& location_in_screen, int component) const; // Windows and direction to resize. @@ -159,11 +160,11 @@ class ASH_EXPORT MultiWindowResizeController : // If non-null we're in a resize loop. scoped_ptr<WorkspaceWindowResizer> window_resizer_; - // Mouse coordinate passed to Show(). - gfx::Point show_location_; + // Mouse coordinate passed to Show() in container's coodinates. + gfx::Point show_location_in_parent_; - // Bounds the widget was last shown at. - gfx::Rect show_bounds_; + // Bounds the widget was last shown at in screen coordinates. + gfx::Rect show_bounds_in_screen_; // Size of the grid. int grid_size_; diff --git a/ash/wm/workspace/workspace_event_filter.cc b/ash/wm/workspace/workspace_event_filter.cc index ae9459c..89218a1 100644 --- a/ash/wm/workspace/workspace_event_filter.cc +++ b/ash/wm/workspace/workspace_event_filter.cc @@ -117,7 +117,7 @@ void WorkspaceEventFilter::OnWindowDestroyed(aura::Window* window) { WindowResizer* WorkspaceEventFilter::CreateWindowResizer( aura::Window* window, - const gfx::Point& point, + const gfx::Point& point_in_parent, int window_component) { // Allow dragging maximized windows if it's not tracked by workspace. This is // set by tab dragging code. @@ -126,7 +126,7 @@ WindowResizer* WorkspaceEventFilter::CreateWindowResizer( return NULL; } return WorkspaceWindowResizer::Create( - window, point, window_component, + window, point_in_parent, window_component, std::vector<aura::Window*>()); } diff --git a/ash/wm/workspace/workspace_event_filter.h b/ash/wm/workspace/workspace_event_filter.h index 0b1b740..25051b7 100644 --- a/ash/wm/workspace/workspace_event_filter.h +++ b/ash/wm/workspace/workspace_event_filter.h @@ -34,9 +34,10 @@ class WorkspaceEventFilter : public ToplevelWindowEventFilter, protected: // Overridden from ToplevelWindowEventFilter: - virtual WindowResizer* CreateWindowResizer(aura::Window* window, - const gfx::Point& point, - int window_component) OVERRIDE; + virtual WindowResizer* CreateWindowResizer( + aura::Window* window, + const gfx::Point& point_in_parent, + int window_component) OVERRIDE; private: friend class WorkspaceEventFilterTestHelper; diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index 78f109bb..a683465 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc @@ -52,10 +52,10 @@ WorkspaceWindowResizer::~WorkspaceWindowResizer() { // static WorkspaceWindowResizer* WorkspaceWindowResizer::Create( aura::Window* window, - const gfx::Point& location, + const gfx::Point& location_in_parent, int window_component, const std::vector<aura::Window*>& attached_windows) { - Details details(window, location, window_component); + Details details(window, location_in_parent, window_component); return details.is_resizable ? new WorkspaceWindowResizer(details, attached_windows) : NULL; } diff --git a/ash/wm/workspace/workspace_window_resizer.h b/ash/wm/workspace/workspace_window_resizer.h index 1edf10dc..3b28e1e 100644 --- a/ash/wm/workspace/workspace_window_resizer.h +++ b/ash/wm/workspace/workspace_window_resizer.h @@ -37,7 +37,7 @@ class ASH_EXPORT WorkspaceWindowResizer : public WindowResizer { static WorkspaceWindowResizer* Create( aura::Window* window, - const gfx::Point& location, + const gfx::Point& location_in_parent, int window_component, const std::vector<aura::Window*>& attached_windows); diff --git a/chrome/browser/ui/ash/tabs/dock_info_ash.cc b/chrome/browser/ui/ash/tabs/dock_info_ash.cc index e5208c1..13bb0a0 100644 --- a/chrome/browser/ui/ash/tabs/dock_info_ash.cc +++ b/chrome/browser/ui/ash/tabs/dock_info_ash.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/tabs/dock_info.h" #include "ash/shell.h" +#include "ui/aura/client/screen_position_client.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/compositor/layer.h" @@ -25,9 +26,8 @@ aura::Window* GetLocalProcessWindowAtPointImpl( if (window->layer()->type() == ui::LAYER_TEXTURED) { gfx::Point window_point(screen_point); - aura::Window::ConvertPointToWindow(ash::Shell::GetPrimaryRootWindow(), - window, - &window_point); + aura::client::GetScreenPositionClient(window->GetRootWindow())-> + ConvertPointFromScreen(window, &window_point); return gfx::Rect(window->bounds().size()).Contains(window_point) ? window : NULL; } @@ -56,7 +56,7 @@ gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint( const gfx::Point& screen_point, const std::set<gfx::NativeView>& ignore) { return GetLocalProcessWindowAtPointImpl( - screen_point, ignore, ash::Shell::GetPrimaryRootWindow()); + screen_point, ignore, ash::Shell::GetRootWindowAt(screen_point)); } bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const { diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index c9c6f26..0c766a5 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc @@ -393,13 +393,13 @@ void TabDragController::Init( DCHECK(std::find(tabs.begin(), tabs.end(), source_tab) != tabs.end()); source_tabstrip_ = source_tabstrip; source_tab_offset_ = source_tab_offset; - start_screen_point_ = gfx::Point(source_tab_offset, mouse_offset.y()); - views::View::ConvertPointToScreen(source_tab, &start_screen_point_); + start_point_in_screen_ = gfx::Point(source_tab_offset, mouse_offset.y()); + views::View::ConvertPointToScreen(source_tab, &start_point_in_screen_); mouse_offset_ = mouse_offset; detach_behavior_ = detach_behavior; move_behavior_ = move_behavior; - last_screen_point_ = start_screen_point_; - last_move_screen_loc_ = start_screen_point_.x(); + last_point_in_screen_ = start_point_in_screen_; + last_move_screen_loc_ = start_point_in_screen_.x(); initial_tab_positions_ = source_tabstrip->GetTabXCoordinates(); if (detach_into_browser_) GetModel(source_tabstrip_)->AddObserver(this); @@ -439,7 +439,7 @@ void TabDragController::SetMoveBehavior(MoveBehavior behavior) { move_behavior_ = behavior; } -void TabDragController::Drag(const gfx::Point& screen_point) { +void TabDragController::Drag(const gfx::Point& point_in_screen) { #if defined(OS_WIN) && !defined(USE_AURA) // Windows coordinates are 16 bit values. When we hide the frame we move it to // the max x/y coordinate. If the distance between the hidden frame and the @@ -448,9 +448,9 @@ void TabDragController::Drag(const gfx::Point& screen_point) { // ignore the coordinates and use the actual cursor position. // NOTE: this works for touch too as dragging with touch updates the mouse // position. - gfx::Point real_screen_point(GetCursorScreenPoint()); + gfx::Point real_point_in_screen(GetCursorScreenPoint()); #else - gfx::Point real_screen_point(screen_point); + gfx::Point real_point_in_screen(point_in_screen); #endif bring_to_front_timer_.Stop(); move_stacked_timer_.Stop(); @@ -459,7 +459,7 @@ void TabDragController::Drag(const gfx::Point& screen_point) { return; if (!started_drag_) { - if (!CanStartDrag(real_screen_point)) + if (!CanStartDrag(real_point_in_screen)) return; // User hasn't dragged far enough yet. started_drag_ = true; @@ -472,7 +472,7 @@ void TabDragController::Drag(const gfx::Point& screen_point) { } } - ContinueDragging(real_screen_point); + ContinueDragging(real_point_in_screen); } void TabDragController::EndDrag(bool canceled) { @@ -668,9 +668,9 @@ gfx::Point TabDragController::GetWindowCreatePoint( create_point.y() - window_create_point_.y()); } -void TabDragController::UpdateDockInfo(const gfx::Point& screen_point) { +void TabDragController::UpdateDockInfo(const gfx::Point& point_in_screen) { // Update the DockInfo for the current mouse coordinates. - DockInfo dock_info = GetDockInfoAtPoint(screen_point); + DockInfo dock_info = GetDockInfoAtPoint(point_in_screen); if (!dock_info.equals(dock_info_)) { // DockInfo for current position differs. if (dock_info_.type() != DockInfo::NONE && @@ -710,59 +710,59 @@ void TabDragController::RestoreFocus() { old_focused_view_ = NULL; } -bool TabDragController::CanStartDrag(const gfx::Point& screen_point) const { +bool TabDragController::CanStartDrag(const gfx::Point& point_in_screen) const { // Determine if the mouse has moved beyond a minimum elasticity distance in // any direction from the starting point. static const int kMinimumDragDistance = 10; - int x_offset = abs(screen_point.x() - start_screen_point_.x()); - int y_offset = abs(screen_point.y() - start_screen_point_.y()); + int x_offset = abs(point_in_screen.x() - start_point_in_screen_.x()); + int y_offset = abs(point_in_screen.y() - start_point_in_screen_.y()); return sqrt(pow(static_cast<float>(x_offset), 2) + pow(static_cast<float>(y_offset), 2)) > kMinimumDragDistance; } -void TabDragController::ContinueDragging(const gfx::Point& screen_point) { +void TabDragController::ContinueDragging(const gfx::Point& point_in_screen) { DCHECK(!detach_into_browser_ || attached_tabstrip_); TabStrip* target_tabstrip = detach_behavior_ == DETACHABLE ? - GetTabStripForPoint(screen_point) : source_tabstrip_; + GetTabStripForPoint(point_in_screen) : source_tabstrip_; bool tab_strip_changed = (target_tabstrip != attached_tabstrip_); if (attached_tabstrip_) { - int move_delta = screen_point.x() - last_screen_point_.x(); + int move_delta = point_in_screen.x() - last_point_in_screen_.x(); if (move_delta > 0) mouse_move_direction_ |= kMovedMouseRight; else if (move_delta < 0) mouse_move_direction_ |= kMovedMouseLeft; } - last_screen_point_ = screen_point; + last_point_in_screen_ = point_in_screen; if (tab_strip_changed) { if (detach_into_browser_ && - DragBrowserToNewTabStrip(target_tabstrip, screen_point) == + DragBrowserToNewTabStrip(target_tabstrip, point_in_screen) == DRAG_BROWSER_RESULT_STOP) { return; } else if (!detach_into_browser_) { if (attached_tabstrip_) Detach(RELEASE_CAPTURE); if (target_tabstrip) - Attach(target_tabstrip, screen_point); + Attach(target_tabstrip, point_in_screen); } } if (view_.get() || is_dragging_window_) { static_cast<base::Timer*>(&bring_to_front_timer_)->Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kBringToFrontDelay), base::Bind(&TabDragController::BringWindowUnderPointToFront, - base::Unretained(this), screen_point)); + base::Unretained(this), point_in_screen)); } - UpdateDockInfo(screen_point); + UpdateDockInfo(point_in_screen); if (!is_dragging_window_) { if (attached_tabstrip_) { if (move_only()) { - DragActiveTabStacked(screen_point); + DragActiveTabStacked(point_in_screen); } else { - MoveAttached(screen_point); + MoveAttached(point_in_screen); if (tab_strip_changed) { // Move the corresponding window to the front. We do this after the // move as on windows activate triggers a synchronous paint. @@ -770,7 +770,7 @@ void TabDragController::ContinueDragging(const gfx::Point& screen_point) { } } } else { - MoveDetached(screen_point); + MoveDetached(point_in_screen); } } } @@ -778,9 +778,9 @@ void TabDragController::ContinueDragging(const gfx::Point& screen_point) { TabDragController::DragBrowserResultType TabDragController::DragBrowserToNewTabStrip( TabStrip* target_tabstrip, - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { if (!target_tabstrip) { - DetachIntoNewBrowserAndRunMoveLoop(screen_point); + DetachIntoNewBrowserAndRunMoveLoop(point_in_screen); return DRAG_BROWSER_RESULT_STOP; } if (is_dragging_window_) { @@ -819,9 +819,9 @@ TabDragController::DragBrowserToNewTabStrip( #if defined(USE_ASH) is_dragging_window_ = false; Detach(DONT_RELEASE_CAPTURE); - Attach(target_tabstrip, screen_point); + Attach(target_tabstrip, point_in_screen); // Move the tabs into position. - MoveAttached(screen_point); + MoveAttached(point_in_screen); attached_tabstrip_->GetWidget()->Activate(); #else tab_strip_to_attach_to_after_exit_ = target_tabstrip; @@ -832,46 +832,48 @@ TabDragController::DragBrowserToNewTabStrip( return DRAG_BROWSER_RESULT_STOP; } Detach(DONT_RELEASE_CAPTURE); - Attach(target_tabstrip, screen_point); + Attach(target_tabstrip, point_in_screen); return DRAG_BROWSER_RESULT_CONTINUE; } void TabDragController::DragActiveTabStacked( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { if (attached_tabstrip_->tab_count() != static_cast<int>(initial_tab_positions_.size())) return; // TODO: should cancel drag if this happens. - int delta = screen_point.x() - start_screen_point_.x(); + int delta = point_in_screen.x() - start_point_in_screen_.x(); attached_tabstrip_->DragActiveTab(initial_tab_positions_, delta); } void TabDragController::MoveAttachedToNextStackedIndex( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { int index = attached_tabstrip_->touch_layout_->active_index(); if (index + 1 >= attached_tabstrip_->tab_count()) return; GetModel(attached_tabstrip_)->MoveSelectedTabsTo(index + 1); - StartMoveStackedTimerIfNecessary(screen_point, kMoveAttachedSubsequentDelay); + StartMoveStackedTimerIfNecessary(point_in_screen, + kMoveAttachedSubsequentDelay); } void TabDragController::MoveAttachedToPreviousStackedIndex( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { int index = attached_tabstrip_->touch_layout_->active_index(); if (index <= attached_tabstrip_->GetMiniTabCount()) return; GetModel(attached_tabstrip_)->MoveSelectedTabsTo(index - 1); - StartMoveStackedTimerIfNecessary(screen_point, kMoveAttachedSubsequentDelay); + StartMoveStackedTimerIfNecessary(point_in_screen, + kMoveAttachedSubsequentDelay); } -void TabDragController::MoveAttached(const gfx::Point& screen_point) { +void TabDragController::MoveAttached(const gfx::Point& point_in_screen) { DCHECK(attached_tabstrip_); DCHECK(!view_.get()); DCHECK(!is_dragging_window_); - gfx::Point dragged_view_point = GetAttachedDragPoint(screen_point); + gfx::Point dragged_view_point = GetAttachedDragPoint(point_in_screen); // Determine the horizontal move threshold. This is dependent on the width // of tabs. The smaller the tabs compared to the standard size, the smaller @@ -893,7 +895,7 @@ void TabDragController::MoveAttached(const gfx::Point& screen_point) { // Update the model, moving the WebContents from one index to another. Do this // only if we have moved a minimum distance since the last reorder (to prevent // jitter) or if this the first move and the tabs are not consecutive. - if ((abs(screen_point.x() - last_move_screen_loc_) > threshold || + if ((abs(point_in_screen.x() - last_move_screen_loc_) > threshold || (initial_move_ && !AreTabsConsecutive()))) { TabStripModel* attached_model = GetModel(attached_tabstrip_); gfx::Rect bounds = GetDraggedViewTabStripBounds(dragged_view_point); @@ -917,7 +919,7 @@ void TabDragController::MoveAttached(const gfx::Point& screen_point) { // last_move_screen_loc_. if (index_of_last_item != attached_model->GetIndexOfTabContents(last_contents)) { - last_move_screen_loc_ = screen_point.x(); + last_move_screen_loc_ = point_in_screen.x(); } } @@ -927,22 +929,22 @@ void TabDragController::MoveAttached(const gfx::Point& screen_point) { initial_move_); } - StartMoveStackedTimerIfNecessary(screen_point, kMoveAttachedInitialDelay); + StartMoveStackedTimerIfNecessary(point_in_screen, kMoveAttachedInitialDelay); initial_move_ = false; } -void TabDragController::MoveDetached(const gfx::Point& screen_point) { +void TabDragController::MoveDetached(const gfx::Point& point_in_screen) { DCHECK(!attached_tabstrip_); DCHECK(view_.get()); DCHECK(!is_dragging_window_); // Move the View. There are no changes to the model if we're detached. - view_->MoveTo(screen_point); + view_->MoveTo(point_in_screen); } void TabDragController::StartMoveStackedTimerIfNecessary( - const gfx::Point& screen_point, + const gfx::Point& point_in_screen, int delay_ms) { DCHECK(attached_tabstrip_); @@ -950,7 +952,7 @@ void TabDragController::StartMoveStackedTimerIfNecessary( if (!touch_layout) return; - gfx::Point dragged_view_point = GetAttachedDragPoint(screen_point); + gfx::Point dragged_view_point = GetAttachedDragPoint(point_in_screen); gfx::Rect bounds = GetDraggedViewTabStripBounds(dragged_view_point); int index = touch_layout->active_index(); if (ShouldDragToNextStackedTab(bounds, index)) { @@ -958,20 +960,20 @@ void TabDragController::StartMoveStackedTimerIfNecessary( FROM_HERE, base::TimeDelta::FromMilliseconds(delay_ms), base::Bind(&TabDragController::MoveAttachedToNextStackedIndex, - base::Unretained(this), screen_point)); + base::Unretained(this), point_in_screen)); } else if (ShouldDragToPreviousStackedTab(bounds, index)) { static_cast<base::Timer*>(&move_stacked_timer_)->Start( FROM_HERE, base::TimeDelta::FromMilliseconds(delay_ms), base::Bind(&TabDragController::MoveAttachedToPreviousStackedIndex, - base::Unretained(this), screen_point)); + base::Unretained(this), point_in_screen)); } } TabDragController::DetachPosition TabDragController::GetDetachPosition( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { DCHECK(attached_tabstrip_); - gfx::Point attached_point(screen_point); + gfx::Point attached_point(point_in_screen); views::View::ConvertPointToView(NULL, attached_tabstrip_, &attached_point); if (attached_point.x() < 0) return DETACH_BEFORE; @@ -980,14 +982,15 @@ TabDragController::DetachPosition TabDragController::GetDetachPosition( return DETACH_ABOVE_OR_BELOW; } -DockInfo TabDragController::GetDockInfoAtPoint(const gfx::Point& screen_point) { +DockInfo TabDragController::GetDockInfoAtPoint( + const gfx::Point& point_in_screen) { // TODO: add support for dock info when |detach_into_browser_| is true. if (attached_tabstrip_ || detach_into_browser_) { // If the mouse is over a tab strip, don't offer a dock position. return DockInfo(); } - if (dock_info_.IsValidForPoint(screen_point)) { + if (dock_info_.IsValidForPoint(point_in_screen)) { // It's possible any given screen coordinate has multiple docking // positions. Check the current info first to avoid having the docking // position bounce around. @@ -996,13 +999,13 @@ DockInfo TabDragController::GetDockInfoAtPoint(const gfx::Point& screen_point) { gfx::NativeView dragged_view = view_->GetWidget()->GetNativeView(); dock_windows_.insert(dragged_view); - DockInfo info = DockInfo::GetDockInfoAtPoint(screen_point, dock_windows_); + DockInfo info = DockInfo::GetDockInfoAtPoint(point_in_screen, dock_windows_); dock_windows_.erase(dragged_view); return info; } TabStrip* TabDragController::GetTabStripForPoint( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { gfx::NativeView dragged_view = NULL; if (view_.get()) dragged_view = view_->GetWidget()->GetNativeView(); @@ -1011,11 +1014,11 @@ TabStrip* TabDragController::GetTabStripForPoint( if (dragged_view) dock_windows_.insert(dragged_view); gfx::NativeWindow local_window = - DockInfo::GetLocalProcessWindowAtPoint(screen_point, dock_windows_); + DockInfo::GetLocalProcessWindowAtPoint(point_in_screen, dock_windows_); if (dragged_view) dock_windows_.erase(dragged_view); TabStrip* tab_strip = GetTabStripForWindow(local_window); - if (tab_strip && DoesTabStripContain(tab_strip, screen_point)) + if (tab_strip && DoesTabStripContain(tab_strip, point_in_screen)) return tab_strip; return is_dragging_window_ ? attached_tabstrip_ : NULL; } @@ -1042,25 +1045,25 @@ TabStrip* TabDragController::GetTabStripForWindow(gfx::NativeWindow window) { bool TabDragController::DoesTabStripContain( TabStrip* tabstrip, - const gfx::Point& screen_point) const { + const gfx::Point& point_in_screen) const { static const int kVerticalDetachMagnetism = 15; // Make sure the specified screen point is actually within the bounds of the // specified tabstrip... gfx::Rect tabstrip_bounds = GetViewScreenBounds(tabstrip); - if (screen_point.x() < tabstrip_bounds.right() && - screen_point.x() >= tabstrip_bounds.x()) { + if (point_in_screen.x() < tabstrip_bounds.right() && + point_in_screen.x() >= tabstrip_bounds.x()) { // TODO(beng): make this be relative to the start position of the mouse // for the source TabStrip. int upper_threshold = tabstrip_bounds.bottom() + kVerticalDetachMagnetism; int lower_threshold = tabstrip_bounds.y() - kVerticalDetachMagnetism; - return screen_point.y() >= lower_threshold && - screen_point.y() <= upper_threshold; + return point_in_screen.y() >= lower_threshold && + point_in_screen.y() <= upper_threshold; } return false; } void TabDragController::Attach(TabStrip* attached_tabstrip, - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { DCHECK(!attached_tabstrip_); // We should already have detached by the time // we get here. @@ -1092,13 +1095,13 @@ void TabDragController::Attach(TabStrip* attached_tabstrip, // Inserting counts as a move. We don't want the tabs to jitter when the // user moves the tab immediately after attaching it. - last_move_screen_loc_ = screen_point.x(); + last_move_screen_loc_ = point_in_screen.x(); // Figure out where to insert the tab based on the bounds of the dragged // representation and the ideal bounds of the other Tabs already in the // strip. ("ideal bounds" are stable even if the Tabs' actual bounds are // changing due to animation). - gfx::Point tab_strip_point(screen_point); + gfx::Point tab_strip_point(point_in_screen); views::View::ConvertPointToView(NULL, attached_tabstrip_, &tab_strip_point); tab_strip_point.set_x( attached_tabstrip_->GetMirroredXInView(tab_strip_point.x())); @@ -1231,7 +1234,7 @@ void TabDragController::Detach(ReleaseCapture release_capture) { } void TabDragController::DetachIntoNewBrowserAndRunMoveLoop( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { if (GetModel(attached_tabstrip_)->count() == static_cast<int>(drag_data_.size())) { // All the tabs in a browser are being dragged but all the tabs weren't @@ -1244,7 +1247,7 @@ void TabDragController::DetachIntoNewBrowserAndRunMoveLoop( // Create a new browser to house the dragged tabs and have the OS run a move // loop. - gfx::Point attached_point = GetAttachedDragPoint(screen_point); + gfx::Point attached_point = GetAttachedDragPoint(point_in_screen); // Calculate the bounds for the tabs from the attached_tab_strip. We do this // so that the tabs don't change size when detached. @@ -1252,7 +1255,7 @@ void TabDragController::DetachIntoNewBrowserAndRunMoveLoop( CalculateBoundsForDraggedTabs(attached_point.x()); Browser* browser = CreateBrowserForDrag( - attached_tabstrip_, screen_point, &drag_bounds); + attached_tabstrip_, point_in_screen, &drag_bounds); Detach(DONT_RELEASE_CAPTURE); BrowserView* dragged_browser_view = BrowserView::GetBrowserViewForBrowser(browser); @@ -1301,11 +1304,11 @@ void TabDragController::RunMoveLoop() { if (end_run_loop_behavior_ == END_RUN_LOOP_CONTINUE_DRAGGING) { end_run_loop_behavior_ = END_RUN_LOOP_STOP_DRAGGING; if (tab_strip_to_attach_to_after_exit_) { - gfx::Point screen_point(GetCursorScreenPoint()); + gfx::Point point_in_screen(GetCursorScreenPoint()); Detach(DONT_RELEASE_CAPTURE); - Attach(tab_strip_to_attach_to_after_exit_, screen_point); + Attach(tab_strip_to_attach_to_after_exit_, point_in_screen); // Move the tabs into position. - MoveAttached(screen_point); + MoveAttached(point_in_screen); attached_tabstrip_->GetWidget()->Activate(); tab_strip_to_attach_to_after_exit_ = NULL; } @@ -1453,10 +1456,10 @@ gfx::Rect TabDragController::GetDraggedViewTabStripBounds( } gfx::Point TabDragController::GetAttachedDragPoint( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { DCHECK(attached_tabstrip_); // The tab must be attached. - gfx::Point tab_loc(screen_point); + gfx::Point tab_loc(point_in_screen); views::View::ConvertPointToView(NULL, attached_tabstrip_, &tab_loc); int x = attached_tabstrip_->GetMirroredXInView(tab_loc.x()) - mouse_offset_.x(); @@ -1694,7 +1697,7 @@ void TabDragController::CompleteDrag() { // Compel the model to construct a new window for the detached WebContents. views::Widget* widget = source_tabstrip_->GetWidget(); gfx::Rect window_bounds(widget->GetRestoredBounds()); - window_bounds.set_origin(GetWindowCreatePoint(last_screen_point_)); + window_bounds.set_origin(GetWindowCreatePoint(last_point_in_screen_)); // When modifying the following if statement, please make sure not to // introduce issue listed in http://crbug.com/6223 comment #11. bool rtl_ui = base::i18n::IsRTL(); @@ -1823,7 +1826,7 @@ void TabDragController::DockDisplayerDestroyed( } void TabDragController::BringWindowUnderPointToFront( - const gfx::Point& screen_point) { + const gfx::Point& point_in_screen) { // If we're going to dock to another window, bring it to the front. gfx::NativeWindow window = dock_info_.window(); if (!window) { @@ -1836,7 +1839,7 @@ void TabDragController::BringWindowUnderPointToFront( dragged_view->GetWidget()->GetNativeView(); dock_windows_.insert(dragged_native_view); window = - DockInfo::GetLocalProcessWindowAtPoint(screen_point, dock_windows_); + DockInfo::GetLocalProcessWindowAtPoint(point_in_screen, dock_windows_); dock_windows_.erase(dragged_native_view); } if (window) { @@ -1878,24 +1881,24 @@ bool TabDragController::AreTabsConsecutive() { Browser* TabDragController::CreateBrowserForDrag( TabStrip* source, - const gfx::Point& screen_point, + const gfx::Point& point_in_screen, std::vector<gfx::Rect>* drag_bounds) { Browser* browser = new Browser( Browser::CreateParams(drag_data_[0].contents->profile())); gfx::Point center(0, source->height() / 2); views::View::ConvertPointToWidget(source, ¢er); gfx::Rect new_bounds(source->GetWidget()->GetWindowBoundsInScreen()); - new_bounds.set_y(screen_point.y() - center.y()); - switch (GetDetachPosition(screen_point)) { + new_bounds.set_y(point_in_screen.y() - center.y()); + switch (GetDetachPosition(point_in_screen)) { case DETACH_BEFORE: - new_bounds.set_x(screen_point.x() - center.x()); + new_bounds.set_x(point_in_screen.x() - center.x()); new_bounds.Offset(-mouse_offset_.x(), 0); break; case DETACH_AFTER: { gfx::Point right_edge(source->width(), 0); views::View::ConvertPointToWidget(source, &right_edge); - new_bounds.set_x(screen_point.x() - right_edge.x()); + new_bounds.set_x(point_in_screen.x() - right_edge.x()); new_bounds.Offset(drag_bounds->back().right() - mouse_offset_.x(), 0); int delta = (*drag_bounds)[0].x(); for (size_t i = 0; i < drag_bounds->size(); ++i) diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.h b/chrome/browser/ui/views/tabs/tab_drag_controller.h index 2ff4b35..38fbc33 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.h +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.h @@ -108,7 +108,7 @@ class TabDragController : public content::WebContentsDelegate, bool started_drag() const { return started_drag_; } // Invoked to drag to the new location, in screen coordinates. - void Drag(const gfx::Point& screen_point); + void Drag(const gfx::Point& point_in_screen); // Complete the current drag session. If the drag session was canceled // because the user pressed escape or something interrupted it, |canceled| @@ -241,7 +241,7 @@ class TabDragController : public content::WebContentsDelegate, // current mouse position |origin|. gfx::Point GetWindowCreatePoint(const gfx::Point& origin) const; - void UpdateDockInfo(const gfx::Point& screen_point); + void UpdateDockInfo(const gfx::Point& point_in_screen); // Saves focus in the window that the drag initiated from. Focus will be // restored appropriately if the drag ends within this same window. @@ -251,40 +251,40 @@ class TabDragController : public content::WebContentsDelegate, // the drag ends within the same Window as it began. void RestoreFocus(); - // Tests whether |screen_point| is past a minimum elasticity threshold + // Tests whether |point_in_screen| is past a minimum elasticity threshold // required to start a drag. - bool CanStartDrag(const gfx::Point& screen_point) const; + bool CanStartDrag(const gfx::Point& point_in_screen) const; // Move the DraggedTabView according to the current mouse screen position, // potentially updating the source and other TabStrips. - void ContinueDragging(const gfx::Point& screen_point); + void ContinueDragging(const gfx::Point& point_in_screen); // Transitions dragging from |attached_tabstrip_| to |target_tabstrip|. // |target_tabstrip| is NULL if the mouse is not over a valid tab strip. See // DragBrowserResultType for details of the return type. DragBrowserResultType DragBrowserToNewTabStrip( TabStrip* target_tabstrip, - const gfx::Point& screen_point); + const gfx::Point& point_in_screen); // Handles dragging for a touch tabstrip when the tabs are stacked. Doesn't // actually reorder the tabs in anyway, just changes what's visible. - void DragActiveTabStacked(const gfx::Point& screen_point); + void DragActiveTabStacked(const gfx::Point& point_in_screen); // Moves the active tab to the next/previous tab. Used when the next/previous // tab is stacked. - void MoveAttachedToNextStackedIndex(const gfx::Point& screen_point); - void MoveAttachedToPreviousStackedIndex(const gfx::Point& screen_point); + void MoveAttachedToNextStackedIndex(const gfx::Point& point_in_screen); + void MoveAttachedToPreviousStackedIndex(const gfx::Point& point_in_screen); // Handles dragging tabs while the tabs are attached. - void MoveAttached(const gfx::Point& screen_point); + void MoveAttached(const gfx::Point& point_in_screen); // Handles dragging while the tabs are detached. - void MoveDetached(const gfx::Point& screen_point); + void MoveDetached(const gfx::Point& point_in_screen); // If necessary starts the |move_stacked_timer_|. The timer is started if // close enough to an edge with stacked tabs. void StartMoveStackedTimerIfNecessary( - const gfx::Point& screen_point, + const gfx::Point& point_in_screen, int delay_ms); // Returns the TabStrip for the specified window, or NULL if one doesn't exist @@ -293,28 +293,28 @@ class TabDragController : public content::WebContentsDelegate, // Returns the compatible TabStrip that is under the specified point (screen // coordinates), or NULL if there is none. - TabStrip* GetTabStripForPoint(const gfx::Point& screen_point); + TabStrip* GetTabStripForPoint(const gfx::Point& point_in_screen); // Returns true if |tabstrip| contains the specified point in screen // coordinates. bool DoesTabStripContain(TabStrip* tabstrip, - const gfx::Point& screen_point) const; + const gfx::Point& point_in_screen) const; // Returns the DetachPosition given the specified location in screen // coordinates. - DetachPosition GetDetachPosition(const gfx::Point& screen_point); + DetachPosition GetDetachPosition(const gfx::Point& point_in_screen); - DockInfo GetDockInfoAtPoint(const gfx::Point& screen_point); + DockInfo GetDockInfoAtPoint(const gfx::Point& point_in_screen); // Attach the dragged Tab to the specified TabStrip. - void Attach(TabStrip* attached_tabstrip, const gfx::Point& screen_point); + void Attach(TabStrip* attached_tabstrip, const gfx::Point& point_in_screen); // Detach the dragged Tab from the current TabStrip. void Detach(ReleaseCapture release_capture); // Detaches the tabs being dragged, creates a new Browser to contain them and // runs a nested move loop. - void DetachIntoNewBrowserAndRunMoveLoop(const gfx::Point& screen_point); + void DetachIntoNewBrowserAndRunMoveLoop(const gfx::Point& point_in_screen); // Runs a nested message loop that handles moving the current Browser. void RunMoveLoop(); @@ -354,7 +354,7 @@ class TabDragController : public content::WebContentsDelegate, // Get the position of the dragged tab view relative to the attached tab // strip with the mirroring transform applied. - gfx::Point GetAttachedDragPoint(const gfx::Point& screen_point); + gfx::Point GetAttachedDragPoint(const gfx::Point& point_in_screen); // Finds the Tabs within the specified TabStrip that corresponds to the // WebContents of the dragged tabs. Returns an empty vector if not attached. @@ -401,7 +401,7 @@ class TabDragController : public content::WebContentsDelegate, void DockDisplayerDestroyed(DockDisplayer* controller); - void BringWindowUnderPointToFront(const gfx::Point& screen_point); + void BringWindowUnderPointToFront(const gfx::Point& point_in_screen); // Convenience for getting the TabDragData corresponding to the tab the user // started dragging. @@ -423,7 +423,7 @@ class TabDragController : public content::WebContentsDelegate, // Creates and returns a new Browser to handle the drag. Browser* CreateBrowserForDrag(TabStrip* source, - const gfx::Point& screen_point, + const gfx::Point& point_in_screen, std::vector<gfx::Rect>* drag_bounds); // Returns the TabStripModel for the specified tabstrip. @@ -457,7 +457,7 @@ class TabDragController : public content::WebContentsDelegate, // The position of the mouse (in screen coordinates) at the start of the drag // operation. This is used to calculate minimum elasticity before a // DraggedTabView is constructed. - gfx::Point start_screen_point_; + gfx::Point start_point_in_screen_; // This is the offset of the mouse from the top left of the Tab where // dragging begun. This is used to ensure that the dragged view is always @@ -546,8 +546,8 @@ class TabDragController : public content::WebContentsDelegate, // is set to kMovedMouseRight | kMovedMouseLeft. int mouse_move_direction_; - // Last location used. - gfx::Point last_screen_point_; + // Last location used in screen coordinates. + gfx::Point last_point_in_screen_; // The following are needed when detaching into a browser // (|detach_into_browser_| is true). |