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

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 trybot 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 bool PanelDragController::CanDrag(Panel* panel) const {
19 return panel->panel_strip()->CanDragPanel(panel);
20 }
21
22 void PanelDragController::StartDragging(Panel* panel) {
23 DCHECK(!dragging_panel_);
24
25 dragging_panel_ = panel;
26 dragging_panel_->panel_strip()->StartDraggingPanel(panel);
27 }
28
29 void PanelDragController::Drag(int delta_x, int delta_y) {
30 DCHECK(dragging_panel_);
31
32 dragging_panel_->panel_strip()->DragPanel(delta_x, delta_y);
33 }
34
35 void PanelDragController::EndDragging(bool cancelled) {
36 DCHECK(dragging_panel_);
37
38 dragging_panel_->panel_strip()->EndDraggingPanel(cancelled);
39 dragging_panel_ = NULL;
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698