| 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_VIEWS_DOWNLOAD_SHELF_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ |
| 7 | 7 |
| 8 #include "app/slide_animation.h" | 8 #include "app/slide_animation.h" |
| 9 #include "chrome/browser/download/download_shelf.h" | 9 #include "chrome/browser/download/download_shelf.h" |
| 10 #include "views/controls/button/button.h" | 10 #include "views/controls/button/button.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public views::View, | 31 public views::View, |
| 32 public views::ButtonListener, | 32 public views::ButtonListener, |
| 33 public views::LinkController, | 33 public views::LinkController, |
| 34 public AnimationDelegate { | 34 public AnimationDelegate { |
| 35 public: | 35 public: |
| 36 explicit DownloadShelfView(TabContents* tab_contents); | 36 explicit DownloadShelfView(TabContents* tab_contents); |
| 37 | 37 |
| 38 // Implementation of View. | 38 // Implementation of View. |
| 39 virtual gfx::Size GetPreferredSize(); | 39 virtual gfx::Size GetPreferredSize(); |
| 40 virtual void Layout(); | 40 virtual void Layout(); |
| 41 virtual void Paint(ChromeCanvas* canvas); | 41 virtual void Paint(gfx::Canvas* canvas); |
| 42 | 42 |
| 43 // Implementation of AnimationDelegate. | 43 // Implementation of AnimationDelegate. |
| 44 virtual void AnimationProgressed(const Animation* animation); | 44 virtual void AnimationProgressed(const Animation* animation); |
| 45 virtual void AnimationEnded(const Animation* animation); | 45 virtual void AnimationEnded(const Animation* animation); |
| 46 | 46 |
| 47 // Implementation of LinkController. | 47 // Implementation of LinkController. |
| 48 // Invoked when the user clicks the 'show all downloads' link button. | 48 // Invoked when the user clicks the 'show all downloads' link button. |
| 49 virtual void LinkActivated(views::Link* source, int event_flags); | 49 virtual void LinkActivated(views::Link* source, int event_flags); |
| 50 | 50 |
| 51 // Implementation of ButtonListener. | 51 // Implementation of ButtonListener. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 void Init(); | 65 void Init(); |
| 66 | 66 |
| 67 // Adds a View representing a download to this DownloadShelfView. | 67 // Adds a View representing a download to this DownloadShelfView. |
| 68 // DownloadShelfView takes ownership of the View, and will delete it as | 68 // DownloadShelfView takes ownership of the View, and will delete it as |
| 69 // necessary. | 69 // necessary. |
| 70 void AddDownloadView(views::View* view); | 70 void AddDownloadView(views::View* view); |
| 71 | 71 |
| 72 // Paints the border. | 72 // Paints the border. |
| 73 void PaintBorder(ChromeCanvas* canvas); | 73 void PaintBorder(gfx::Canvas* canvas); |
| 74 | 74 |
| 75 // The animation for adding new items to the shelf. | 75 // The animation for adding new items to the shelf. |
| 76 scoped_ptr<SlideAnimation> new_item_animation_; | 76 scoped_ptr<SlideAnimation> new_item_animation_; |
| 77 | 77 |
| 78 // The show/hide animation for the shelf itself. | 78 // The show/hide animation for the shelf itself. |
| 79 scoped_ptr<SlideAnimation> shelf_animation_; | 79 scoped_ptr<SlideAnimation> shelf_animation_; |
| 80 | 80 |
| 81 // The download views. These are also child Views, and deleted when | 81 // The download views. These are also child Views, and deleted when |
| 82 // the DownloadShelfView is deleted. | 82 // the DownloadShelfView is deleted. |
| 83 std::vector<View*> download_views_; | 83 std::vector<View*> download_views_; |
| 84 | 84 |
| 85 // An image displayed on the right of the "Show all downloads..." link. | 85 // An image displayed on the right of the "Show all downloads..." link. |
| 86 views::ImageView* arrow_image_; | 86 views::ImageView* arrow_image_; |
| 87 | 87 |
| 88 // Link for showing all downloads. This is contained as a child, and deleted | 88 // Link for showing all downloads. This is contained as a child, and deleted |
| 89 // by View. | 89 // by View. |
| 90 views::Link* show_all_view_; | 90 views::Link* show_all_view_; |
| 91 | 91 |
| 92 // Button for closing the downloads. This is contained as a child, and | 92 // Button for closing the downloads. This is contained as a child, and |
| 93 // deleted by View. | 93 // deleted by View. |
| 94 views::ImageButton* close_button_; | 94 views::ImageButton* close_button_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); | 96 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 #endif // CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ | 99 #endif // CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ |
| OLD | NEW |