OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_DROP_INFO_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_DROP_INFO_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DROP_INFO_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DROP_INFO_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/timer.h" | 9 #include "base/timer.h" |
10 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 namespace views { | 13 namespace ui { |
14 class DropTargetEvent; | 14 class DropTargetEvent; |
15 } | 15 } |
16 | 16 |
17 // BookmarkDropInfo is a pure virtual class that provides auto-scrolling | 17 // BookmarkDropInfo is a pure virtual class that provides auto-scrolling |
18 // behavior and a handful of fields used for managing a bookmark drop. | 18 // behavior and a handful of fields used for managing a bookmark drop. |
19 // BookmarkDropInfo is used by both BookmarkTableView and | 19 // BookmarkDropInfo is used by both BookmarkTableView and |
20 // BookmarksFolderTreeView. | 20 // BookmarksFolderTreeView. |
21 class BookmarkDropInfo { | 21 class BookmarkDropInfo { |
22 public: | 22 public: |
23 BookmarkDropInfo(gfx::NativeWindow hwnd, int top_margin); | 23 BookmarkDropInfo(gfx::NativeWindow hwnd, int top_margin); |
24 virtual ~BookmarkDropInfo(); | 24 virtual ~BookmarkDropInfo(); |
25 | 25 |
26 // Invoke this from OnDragUpdated. It resets source_operations, | 26 // Invoke this from OnDragUpdated. It resets source_operations, |
27 // is_control_down, last_y and updates the autoscroll timer as necessary. | 27 // is_control_down, last_y and updates the autoscroll timer as necessary. |
28 void Update(const views::DropTargetEvent& event); | 28 void Update(const ui::DropTargetEvent& event); |
29 | 29 |
30 // Data from the drag. | 30 // Data from the drag. |
31 void SetData(const BookmarkNodeData& data) { data_ = data; } | 31 void SetData(const BookmarkNodeData& data) { data_ = data; } |
32 BookmarkNodeData& data() { return data_; } | 32 BookmarkNodeData& data() { return data_; } |
33 | 33 |
34 // Value of event.GetSourceOperations when Update was last invoked. | 34 // Value of event.GetSourceOperations when Update was last invoked. |
35 int source_operations() const { return source_operations_; } | 35 int source_operations() const { return source_operations_; } |
36 | 36 |
37 // Whether the control key was down last time Update was invoked. | 37 // Whether the control key was down last time Update was invoked. |
38 bool is_control_down() const { return is_control_down_; } | 38 bool is_control_down() const { return is_control_down_; } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // When autoscrolling this determines if we're scrolling up or down. | 76 // When autoscrolling this determines if we're scrolling up or down. |
77 bool scroll_up_; | 77 bool scroll_up_; |
78 | 78 |
79 // Used when autoscrolling. | 79 // Used when autoscrolling. |
80 base::RepeatingTimer<BookmarkDropInfo> scroll_timer_; | 80 base::RepeatingTimer<BookmarkDropInfo> scroll_timer_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(BookmarkDropInfo); | 82 DISALLOW_COPY_AND_ASSIGN(BookmarkDropInfo); |
83 }; | 83 }; |
84 | 84 |
85 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DROP_INFO_H_ | 85 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DROP_INFO_H_ |
OLD | NEW |