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

Side by Side Diff: chrome/browser/ui/panels/panel_drag_controller.cc

Issue 9403035: Refactor intra-strip panel drags by introducing PanelDragController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/panels/panel_drag_controller.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/ui/panels/panel.h"
9 #include "chrome/browser/ui/panels/panel_strip.h"
10
11 PanelDragController::PanelDragController()
12 : dragging_panel_(NULL) {
13 }
14
15 PanelDragController::~PanelDragController() {
16 }
17
18 void PanelDragController::StartDragging(Panel* panel) {
19 DCHECK(!dragging_panel_);
20 DCHECK(panel->draggable());
21
22 dragging_panel_ = panel;
23 dragging_panel_->panel_strip()->StartDraggingPanel(panel);
24 dragging_panel_original_position_ = panel->GetBounds().origin();
jennb 2012/02/21 20:01:46 nit: Should we save the position before calling St
25 }
26
27 void PanelDragController::Drag(int delta_x, int delta_y) {
28 DCHECK(dragging_panel_);
29
30 dragging_panel_->panel_strip()->DragPanel(dragging_panel_, delta_x, delta_y);
31 }
32
33 void PanelDragController::EndDragging(bool cancelled) {
34 DCHECK(dragging_panel_);
35
36 dragging_panel_->panel_strip()->EndDraggingPanel(dragging_panel_, cancelled);
37 dragging_panel_ = NULL;
38 }
39
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698