OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chrome/browser/download/download_shelf.h" | 12 #include "chrome/browser/download/download_shelf.h" |
13 #include "ui/gfx/animation/animation_delegate.h" | 13 #include "ui/gfx/animation/animation_delegate.h" |
14 #include "ui/gfx/animation/slide_animation.h" | |
14 #include "ui/views/accessible_pane_view.h" | 15 #include "ui/views/accessible_pane_view.h" |
15 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
16 #include "ui/views/controls/link_listener.h" | 17 #include "ui/views/controls/link_listener.h" |
17 #include "ui/views/mouse_watcher.h" | 18 #include "ui/views/mouse_watcher.h" |
18 | 19 |
19 class Browser; | 20 class Browser; |
20 class BrowserView; | 21 class BrowserView; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 class DownloadItem; | 24 class DownloadItem; |
24 class PageNavigator; | 25 class PageNavigator; |
25 } | 26 } |
26 | 27 |
27 namespace gfx { | |
28 class SlideAnimation; | |
29 } | |
30 | |
31 namespace views { | 28 namespace views { |
32 class ImageButton; | 29 class ImageButton; |
33 class ImageView; | 30 class ImageView; |
34 } | 31 } |
35 | 32 |
36 // DownloadShelfView is a view that contains individual views for each download, | 33 // DownloadShelfView is a view that contains individual views for each download, |
37 // as well as a close button and a link to show all downloads. | 34 // as well as a close button and a link to show all downloads. |
38 // | 35 // |
39 // DownloadShelfView does not hold an infinite number of download views, rather | 36 // DownloadShelfView does not hold an infinite number of download views, rather |
40 // it'll automatically remove views once a certain point is reached. | 37 // it'll automatically remove views once a certain point is reached. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 bool CanAutoClose(); | 121 bool CanAutoClose(); |
125 | 122 |
126 // Gets the |DownloadItem| for the i^th download view. TODO(estade): this | 123 // Gets the |DownloadItem| for the i^th download view. TODO(estade): this |
127 // shouldn't be necessary after we only have one type of DownloadItemView. | 124 // shouldn't be necessary after we only have one type of DownloadItemView. |
128 content::DownloadItem* GetDownloadItemForView(size_t i); | 125 content::DownloadItem* GetDownloadItemForView(size_t i); |
129 | 126 |
130 // The browser for this shelf. | 127 // The browser for this shelf. |
131 Browser* browser_; | 128 Browser* browser_; |
132 | 129 |
133 // The animation for adding new items to the shelf. | 130 // The animation for adding new items to the shelf. |
134 scoped_ptr<gfx::SlideAnimation> new_item_animation_; | 131 gfx::SlideAnimation new_item_animation_; |
135 | 132 |
136 // The show/hide animation for the shelf itself. | 133 // The show/hide animation for the shelf itself. |
137 scoped_ptr<gfx::SlideAnimation> shelf_animation_; | 134 gfx::SlideAnimation shelf_animation_; |
Evan Stade
2015/09/25 00:48:08
no idea why these were heap allocated previously (
groby-ooo-7-16
2015/09/28 18:17:47
Not that it particularly matters, but it keeps the
| |
138 | 135 |
139 // The download views. These are also child Views, and deleted when | 136 // The download views. These are also child Views, and deleted when |
140 // the DownloadShelfView is deleted. | 137 // the DownloadShelfView is deleted. |
141 std::vector<views::View*> download_views_; | 138 std::vector<views::View*> download_views_; |
142 | 139 |
143 // An image displayed on the right of the "Show all downloads..." link. | 140 // An image displayed on the right of the "Show all downloads..." link. |
141 // TODO(estade): not shown in MD; remove. | |
144 views::ImageView* arrow_image_; | 142 views::ImageView* arrow_image_; |
145 | 143 |
146 // Link for showing all downloads. This is contained as a child, and deleted | 144 // Link for showing all downloads. For MD this is a system style button. |
147 // by View. | 145 views::View* show_all_view_; |
148 views::Link* show_all_view_; | |
149 | 146 |
150 // Button for closing the downloads. This is contained as a child, and | 147 // Button for closing the downloads. This is contained as a child, and |
151 // deleted by View. | 148 // deleted by View. |
152 views::ImageButton* close_button_; | 149 views::ImageButton* close_button_; |
153 | 150 |
154 // The window this shelf belongs to. | 151 // The window this shelf belongs to. |
155 BrowserView* parent_; | 152 BrowserView* parent_; |
156 | 153 |
157 views::MouseWatcher mouse_watcher_; | 154 views::MouseWatcher mouse_watcher_; |
158 | 155 |
159 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); | 156 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); |
160 }; | 157 }; |
161 | 158 |
162 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ | 159 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ |
OLD | NEW |