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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "chrome/browser/download/download_shelf.h" | 13 #include "chrome/browser/download/download_shelf.h" |
14 #include "ui/base/animation/animation_delegate.h" | 14 #include "ui/base/animation/animation_delegate.h" |
15 #include "ui/views/accessible_pane_view.h" | 15 #include "ui/views/accessible_pane_view.h" |
16 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
17 #include "ui/views/controls/link_listener.h" | 17 #include "ui/views/controls/link_listener.h" |
18 #include "ui/views/mouse_watcher.h" | 18 #include "ui/views/mouse_watcher.h" |
19 | 19 |
20 class BaseDownloadItemModel; | 20 class BaseDownloadItemModel; |
21 class Browser; | 21 class Browser; |
22 class BrowserView; | 22 class BrowserView; |
23 class DownloadItemView; | 23 class DownloadItemView; |
24 | 24 |
| 25 namespace content { |
| 26 class PageNavigator; |
| 27 } |
| 28 |
25 namespace ui { | 29 namespace ui { |
26 class SlideAnimation; | 30 class SlideAnimation; |
27 } | 31 } |
28 | 32 |
29 namespace views { | 33 namespace views { |
30 class ImageButton; | 34 class ImageButton; |
31 class ImageView; | 35 class ImageView; |
32 } | 36 } |
33 | 37 |
34 // DownloadShelfView is a view that contains individual views for each download, | 38 // DownloadShelfView is a view that contains individual views for each download, |
35 // as well as a close button and a link to show all downloads. | 39 // as well as a close button and a link to show all downloads. |
36 // | 40 // |
37 // DownloadShelfView does not hold an infinite number of download views, rather | 41 // DownloadShelfView does not hold an infinite number of download views, rather |
38 // it'll automatically remove views once a certain point is reached. | 42 // it'll automatically remove views once a certain point is reached. |
39 class DownloadShelfView : public views::AccessiblePaneView, | 43 class DownloadShelfView : public views::AccessiblePaneView, |
40 public ui::AnimationDelegate, | 44 public ui::AnimationDelegate, |
41 public DownloadShelf, | 45 public DownloadShelf, |
42 public views::ButtonListener, | 46 public views::ButtonListener, |
43 public views::LinkListener, | 47 public views::LinkListener, |
44 public views::MouseWatcherListener { | 48 public views::MouseWatcherListener { |
45 public: | 49 public: |
46 DownloadShelfView(Browser* browser, BrowserView* parent); | 50 DownloadShelfView(Browser* browser, BrowserView* parent); |
47 virtual ~DownloadShelfView(); | 51 virtual ~DownloadShelfView(); |
48 | 52 |
49 // Sent from the DownloadItemView when the user opens an item. | 53 // Sent from the DownloadItemView when the user opens an item. |
50 void OpenedDownload(DownloadItemView* view); | 54 void OpenedDownload(DownloadItemView* view); |
51 | 55 |
| 56 // Returns the relevant containing object that can load pages. |
| 57 // i.e. the |browser_|. |
| 58 content::PageNavigator* GetNavigator(); |
| 59 |
52 // Implementation of View. | 60 // Implementation of View. |
53 virtual gfx::Size GetPreferredSize() OVERRIDE; | 61 virtual gfx::Size GetPreferredSize() OVERRIDE; |
54 virtual void Layout() OVERRIDE; | 62 virtual void Layout() OVERRIDE; |
55 virtual void ViewHierarchyChanged(bool is_add, | 63 virtual void ViewHierarchyChanged(bool is_add, |
56 View* parent, | 64 View* parent, |
57 View* child) OVERRIDE; | 65 View* child) OVERRIDE; |
58 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 66 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
59 | 67 |
60 // Implementation of ui::AnimationDelegate. | 68 // Implementation of ui::AnimationDelegate. |
61 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 69 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 169 |
162 // Whether we are auto-closing. | 170 // Whether we are auto-closing. |
163 bool auto_closed_; | 171 bool auto_closed_; |
164 | 172 |
165 views::MouseWatcher mouse_watcher_; | 173 views::MouseWatcher mouse_watcher_; |
166 | 174 |
167 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); | 175 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); |
168 }; | 176 }; |
169 | 177 |
170 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ | 178 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ |
OLD | NEW |