Chromium Code Reviews| 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 "chrome/browser/ui/views/frame/browser_view.h" | |
| 13 #include "ui/gfx/animation/animation_delegate.h" | 14 #include "ui/gfx/animation/animation_delegate.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 DownloadItemView; | 21 class DownloadItemView; |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class DownloadItem; | 24 class DownloadItem; |
| 25 class PageNavigator; | 25 class PageNavigator; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace gfx { | 28 namespace gfx { |
| 29 class SlideAnimation; | 29 class SlideAnimation; |
| 30 } | 30 } |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 47 public views::MouseWatcherListener { | 47 public views::MouseWatcherListener { |
| 48 public: | 48 public: |
| 49 DownloadShelfView(Browser* browser, BrowserView* parent); | 49 DownloadShelfView(Browser* browser, BrowserView* parent); |
| 50 virtual ~DownloadShelfView(); | 50 virtual ~DownloadShelfView(); |
| 51 | 51 |
| 52 // Sent from the DownloadItemView when the user opens an item. | 52 // Sent from the DownloadItemView when the user opens an item. |
| 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(); |
|
Peter Kasting
2014/02/04 21:56:33
Nit: While here: There's no need for this function
felt
2014/02/04 23:37:22
I'll send a follow-up CL for this.
| |
| 58 | 58 |
| 59 // Returns the parent_. | |
| 60 BrowserView* GetParentWindowView(); | |
|
Peter Kasting
2014/02/04 21:56:33
Nit: This function should be inlined and named lik
felt
2014/02/04 23:37:22
Done.
| |
| 61 | |
| 59 // Implementation of View. | 62 // Implementation of View. |
| 60 virtual gfx::Size GetPreferredSize() OVERRIDE; | 63 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 61 virtual void Layout() OVERRIDE; | 64 virtual void Layout() OVERRIDE; |
| 62 virtual void ViewHierarchyChanged( | 65 virtual void ViewHierarchyChanged( |
| 63 const ViewHierarchyChangedDetails& details) OVERRIDE; | 66 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 64 | 67 |
| 65 // Implementation of gfx::AnimationDelegate. | 68 // Implementation of gfx::AnimationDelegate. |
| 66 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 69 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
| 67 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 70 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; |
| 68 | 71 |
| 69 // Implementation of views::LinkListener. | 72 // Implementation of views::LinkListener. |
| 70 // Invoked when the user clicks the 'show all downloads' link button. | 73 // Invoked when the user clicks the 'show all downloads' link button. |
| 71 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 74 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
| 72 | 75 |
| 73 // Implementation of ButtonListener. | 76 // Implementation of ButtonListener. |
| 74 // 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 |
| 75 // hide the download shelf. | 78 // hide the download shelf. |
| 76 virtual void ButtonPressed(views::Button* button, | 79 virtual void ButtonPressed(views::Button* button, |
| 77 const ui::Event& event) OVERRIDE; | 80 const ui::Event& event) OVERRIDE; |
| 78 | 81 |
| 79 // Implementation of DownloadShelf. | 82 // Implementation of DownloadShelf. |
| 80 virtual bool IsShowing() const OVERRIDE; | 83 virtual bool IsShowing() const OVERRIDE; |
| 81 virtual bool IsClosing() const OVERRIDE; | 84 virtual bool IsClosing() const OVERRIDE; |
| 82 virtual Browser* browser() const OVERRIDE; | 85 virtual Browser* browser() const OVERRIDE; |
|
Peter Kasting
2014/02/04 21:56:33
Nit: While here: Virtual functions must never be n
felt
2014/02/04 23:37:22
I'll send a follow-up CL for this.
| |
| 83 | 86 |
| 84 // Implementation of MouseWatcherListener OVERRIDE. | 87 // Implementation of MouseWatcherListener OVERRIDE. |
| 85 virtual void MouseMovedOutOfHost() OVERRIDE; | 88 virtual void MouseMovedOutOfHost() OVERRIDE; |
| 86 | 89 |
| 87 // Removes a specified download view. The supplied view is deleted after | 90 // Removes a specified download view. The supplied view is deleted after |
| 88 // it's removed. | 91 // it's removed. |
| 89 void RemoveDownloadView(views::View* view); | 92 void RemoveDownloadView(views::View* view); |
| 90 | 93 |
| 91 protected: | 94 protected: |
| 92 // Implementation of DownloadShelf. | 95 // Implementation of DownloadShelf. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 | 151 |
| 149 // The window this shelf belongs to. | 152 // The window this shelf belongs to. |
| 150 BrowserView* parent_; | 153 BrowserView* parent_; |
| 151 | 154 |
| 152 views::MouseWatcher mouse_watcher_; | 155 views::MouseWatcher mouse_watcher_; |
| 153 | 156 |
| 154 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); | 157 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ | 160 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_VIEW_H_ |
| OLD | NEW |