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

Unified Diff: chrome/browser/ui/panels/panel_browser_view.cc

Issue 7706027: Addition testing for panels drag and drop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For testing on windows Created 9 years, 4 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 | « no previous file | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_browser_view.cc
diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc
index ad6fe5d449773410fcd7aee46a926d493c3e0541..854d70330663de09155413f5f2a4883c2cc6594d 100644
--- a/chrome/browser/ui/panels/panel_browser_view.cc
+++ b/chrome/browser/ui/panels/panel_browser_view.cc
@@ -332,9 +332,9 @@ bool PanelBrowserView::OnTitlebarMouseDragged(const gfx::Point& location) {
if (!mouse_pressed_)
return false;
- // We do not allow dragging vertically.
int delta_x = location.x() - mouse_pressed_point_.x();
- if (!mouse_dragging_ && ExceededDragThreshold(delta_x, 0)) {
+ int delta_y = location.y() - mouse_pressed_point_.y();
+ if (!mouse_dragging_ && ExceededDragThreshold(delta_x, delta_y)) {
panel_->manager()->StartDragging(panel_.get());
mouse_dragging_ = true;
}
@@ -419,9 +419,12 @@ void NativePanelTestingWin::ReleaseMouseButtonTitlebar() {
}
void NativePanelTestingWin::DragTitlebar(int delta_x, int delta_y) {
- gfx::Rect current_bounds = panel_browser_view_->panel()->GetRestoredBounds();
+ // TODO(jianli): Need a comment here that explains why we use
+ // mouse_pressed_point_ and not current bounds as obtained by
+ // GetRestoredBounds().
panel_browser_view_->OnTitlebarMouseDragged(gfx::Point(
- current_bounds.x() + delta_x, current_bounds.y() + delta_y));
+ panel_browser_view_->mouse_pressed_point_.x() + delta_x,
+ panel_browser_view_->mouse_pressed_point_.y() + delta_y));
}
void NativePanelTestingWin::CancelDragTitlebar() {
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698