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" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void OpenedDownload(DownloadItemView* view); | 53 void OpenedDownload(DownloadItemView* view); |
54 | 54 |
55 // Returns the relevant containing object that can load pages. | 55 // Returns the relevant containing object that can load pages. |
56 // i.e. the |browser_|. | 56 // i.e. the |browser_|. |
57 content::PageNavigator* GetNavigator(); | 57 content::PageNavigator* GetNavigator(); |
58 | 58 |
59 // Returns the parent_. | 59 // Returns the parent_. |
60 BrowserView* get_parent() { return parent_; } | 60 BrowserView* get_parent() { return parent_; } |
61 | 61 |
62 // Implementation of View. | 62 // Implementation of View. |
63 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 63 virtual gfx::Size GetPreferredSize() const override; |
64 virtual void Layout() OVERRIDE; | 64 virtual void Layout() override; |
65 virtual void ViewHierarchyChanged( | 65 virtual void ViewHierarchyChanged( |
66 const ViewHierarchyChangedDetails& details) OVERRIDE; | 66 const ViewHierarchyChangedDetails& details) override; |
67 | 67 |
68 // Implementation of gfx::AnimationDelegate. | 68 // Implementation of gfx::AnimationDelegate. |
69 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 69 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
70 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 70 virtual void AnimationEnded(const gfx::Animation* animation) override; |
71 | 71 |
72 // Implementation of views::LinkListener. | 72 // Implementation of views::LinkListener. |
73 // Invoked when the user clicks the 'show all downloads' link button. | 73 // Invoked when the user clicks the 'show all downloads' link button. |
74 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 74 virtual void LinkClicked(views::Link* source, int event_flags) override; |
75 | 75 |
76 // Implementation of ButtonListener. | 76 // Implementation of ButtonListener. |
77 // Invoked when the user clicks the close button. Asks the browser to | 77 // Invoked when the user clicks the close button. Asks the browser to |
78 // hide the download shelf. | 78 // hide the download shelf. |
79 virtual void ButtonPressed(views::Button* button, | 79 virtual void ButtonPressed(views::Button* button, |
80 const ui::Event& event) OVERRIDE; | 80 const ui::Event& event) override; |
81 | 81 |
82 // Implementation of DownloadShelf. | 82 // Implementation of DownloadShelf. |
83 virtual bool IsShowing() const OVERRIDE; | 83 virtual bool IsShowing() const override; |
84 virtual bool IsClosing() const OVERRIDE; | 84 virtual bool IsClosing() const override; |
85 virtual Browser* browser() const OVERRIDE; | 85 virtual Browser* browser() const override; |
86 | 86 |
87 // Implementation of MouseWatcherListener OVERRIDE. | 87 // Implementation of MouseWatcherListener override. |
88 virtual void MouseMovedOutOfHost() OVERRIDE; | 88 virtual void MouseMovedOutOfHost() override; |
89 | 89 |
90 // Removes a specified download view. The supplied view is deleted after | 90 // Removes a specified download view. The supplied view is deleted after |
91 // it's removed. | 91 // it's removed. |
92 void RemoveDownloadView(views::View* view); | 92 void RemoveDownloadView(views::View* view); |
93 | 93 |
94 protected: | 94 protected: |
95 // Implementation of DownloadShelf. | 95 // Implementation of DownloadShelf. |
96 virtual void DoAddDownload(content::DownloadItem* download) OVERRIDE; | 96 virtual void DoAddDownload(content::DownloadItem* download) override; |
97 virtual void DoShow() OVERRIDE; | 97 virtual void DoShow() override; |
98 virtual void DoClose(CloseReason reason) OVERRIDE; | 98 virtual void DoClose(CloseReason reason) override; |
99 | 99 |
100 // From AccessiblePaneView | 100 // From AccessiblePaneView |
101 virtual views::View* GetDefaultFocusableChild() OVERRIDE; | 101 virtual views::View* GetDefaultFocusableChild() override; |
102 | 102 |
103 private: | 103 private: |
104 // Adds a View representing a download to this DownloadShelfView. | 104 // Adds a View representing a download to this DownloadShelfView. |
105 // DownloadShelfView takes ownership of the View, and will delete it as | 105 // DownloadShelfView takes ownership of the View, and will delete it as |
106 // necessary. | 106 // necessary. |
107 void AddDownloadView(DownloadItemView* view); | 107 void AddDownloadView(DownloadItemView* view); |
108 | 108 |
109 // Paints the border. | 109 // Paints the border. |
110 virtual void OnPaintBorder(gfx::Canvas* canvas) OVERRIDE; | 110 virtual void OnPaintBorder(gfx::Canvas* canvas) override; |
111 | 111 |
112 // Returns true if the shelf is wide enough to show the first download item. | 112 // Returns true if the shelf is wide enough to show the first download item. |
113 bool CanFitFirstDownloadItem(); | 113 bool CanFitFirstDownloadItem(); |
114 | 114 |
115 // Called on theme change. | 115 // Called on theme change. |
116 void UpdateColorsFromTheme(); | 116 void UpdateColorsFromTheme(); |
117 | 117 |
118 // Overridden from views::View. | 118 // Overridden from views::View. |
119 virtual void OnThemeChanged() OVERRIDE; | 119 virtual void OnThemeChanged() override; |
120 | 120 |
121 // Called when the "close shelf" animation ended. | 121 // Called when the "close shelf" animation ended. |
122 void Closed(); | 122 void Closed(); |
123 | 123 |
124 // Returns true if we can auto close. We can auto-close if all the items on | 124 // Returns true if we can auto close. We can auto-close if all the items on |
125 // the shelf have been opened. | 125 // the shelf have been opened. |
126 bool CanAutoClose(); | 126 bool CanAutoClose(); |
127 | 127 |
128 // The browser for this shelf. | 128 // The browser for this shelf. |
129 Browser* browser_; | 129 Browser* browser_; |
(...skipping 21 matching lines...) Expand all Loading... |
151 | 151 |
152 // The window this shelf belongs to. | 152 // The window this shelf belongs to. |
153 BrowserView* parent_; | 153 BrowserView* parent_; |
154 | 154 |
155 views::MouseWatcher mouse_watcher_; | 155 views::MouseWatcher mouse_watcher_; |
156 | 156 |
157 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); | 157 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); |
158 }; | 158 }; |
159 | 159 |
160 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ | 160 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ |
OLD | NEW |