forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
views: Pull out DragController class into its own header file.
BUG=72040 TEST=None R=ben@chromium.org Review URL: http://codereview.chromium.org/7202015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89921 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
tfarina@chromium.org
committed
Jun 21, 2011
1 parent
afbf65f
commit 3eaa3a8
Showing
12 changed files
with
64 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) 2011 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef VIEWS_EVENTS_DRAG_CONTROLLER_H_ | ||
#define VIEWS_EVENTS_DRAG_CONTROLLER_H_ | ||
#pragma once | ||
|
||
namespace gfx { | ||
class Point; | ||
} | ||
|
||
namespace ui { | ||
class OSExchangeData; | ||
} | ||
|
||
namespace views { | ||
class View; | ||
|
||
// DragController is responsible for writing drag data for a view, as well as | ||
// supplying the supported drag operations. Use DragController if you don't | ||
// want to subclass. | ||
class DragController { | ||
public: | ||
// Writes the data for the drag. | ||
virtual void WriteDragDataForView(View* sender, | ||
const gfx::Point& press_pt, | ||
OSExchangeData* data) = 0; | ||
|
||
// Returns the supported drag operations (see DragDropTypes for possible | ||
// values). A drag is only started if this returns a non-zero value. | ||
virtual int GetDragOperationsForView(View* sender, | ||
const gfx::Point& p) = 0; | ||
|
||
// Returns true if a drag operation can be started. | ||
// |press_pt| represents the coordinates where the mouse was initially | ||
// pressed down. |p| is the current mouse coordinates. | ||
virtual bool CanStartDragForView(View* sender, | ||
const gfx::Point& press_pt, | ||
const gfx::Point& p) = 0; | ||
|
||
protected: | ||
virtual ~DragController() {} | ||
}; | ||
|
||
} // namespace views | ||
|
||
#endif // VIEWS_EVENTS_DRAG_CONTROLLER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters