| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SHELF_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_DOWNLOAD_SHELF_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_SHELF_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_SHELF_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/download/download_shelf.h" | 9 #include "chrome/browser/download/download_shelf.h" |
| 10 #include "chrome/browser/ui/views/accessible_pane_view.h" | 10 #include "chrome/browser/ui/views/accessible_pane_view.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Invoked when the user clicks the close button. Asks the browser to | 63 // Invoked when the user clicks the close button. Asks the browser to |
| 64 // hide the download shelf. | 64 // hide the download shelf. |
| 65 virtual void ButtonPressed(views::Button* button, const views::Event& event); | 65 virtual void ButtonPressed(views::Button* button, const views::Event& event); |
| 66 | 66 |
| 67 // Implementation of DownloadShelf. | 67 // Implementation of DownloadShelf. |
| 68 virtual void AddDownload(BaseDownloadItemModel* download_model); | 68 virtual void AddDownload(BaseDownloadItemModel* download_model); |
| 69 virtual bool IsShowing() const; | 69 virtual bool IsShowing() const; |
| 70 virtual bool IsClosing() const; | 70 virtual bool IsClosing() const; |
| 71 virtual void Show(); | 71 virtual void Show(); |
| 72 virtual void Close(); | 72 virtual void Close(); |
| 73 virtual Browser* browser() const { return browser_; } | 73 virtual Browser* browser() const; |
| 74 | 74 |
| 75 // Implementation of MouseWatcherDelegate. | 75 // Implementation of MouseWatcherDelegate. |
| 76 virtual void MouseMovedOutOfView(); | 76 virtual void MouseMovedOutOfView(); |
| 77 | 77 |
| 78 // Override views::FocusChangeListener method from AccessiblePaneView. | 78 // Override views::FocusChangeListener method from AccessiblePaneView. |
| 79 virtual void FocusWillChange(View* focused_before, | 79 virtual void FocusWillChange(View* focused_before, |
| 80 View* focused_now); | 80 View* focused_now); |
| 81 | 81 |
| 82 // Removes a specified download view. The supplied view is deleted after | 82 // Removes a specified download view. The supplied view is deleted after |
| 83 // it's removed. | 83 // it's removed. |
| 84 void RemoveDownloadView(views::View* view); | 84 void RemoveDownloadView(views::View* view); |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 // From AccessiblePaneView | 87 // From AccessiblePaneView |
| 88 virtual views::View* GetDefaultFocusableChild(); | 88 virtual views::View* GetDefaultFocusableChild(); |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 void Init(); | 91 void Init(); |
| 92 | 92 |
| 93 // Adds a View representing a download to this DownloadShelfView. | 93 // Adds a View representing a download to this DownloadShelfView. |
| 94 // DownloadShelfView takes ownership of the View, and will delete it as | 94 // DownloadShelfView takes ownership of the View, and will delete it as |
| 95 // necessary. | 95 // necessary. |
| 96 void AddDownloadView(DownloadItemView* view); | 96 void AddDownloadView(DownloadItemView* view); |
| 97 | 97 |
| 98 // Paints the border. | 98 // Paints the border. |
| 99 void OnPaintBorder(gfx::Canvas* canvas); | 99 virtual void OnPaintBorder(gfx::Canvas* canvas); |
| 100 | 100 |
| 101 // Returns true if the shelf is wide enough to show the first download item. | 101 // Returns true if the shelf is wide enough to show the first download item. |
| 102 bool CanFitFirstDownloadItem(); | 102 bool CanFitFirstDownloadItem(); |
| 103 | 103 |
| 104 // Called on theme change. | 104 // Called on theme change. |
| 105 void UpdateButtonColors(); | 105 void UpdateButtonColors(); |
| 106 | 106 |
| 107 // Overridden from views::View. | 107 // Overridden from views::View. |
| 108 virtual void OnThemeChanged(); | 108 virtual void OnThemeChanged(); |
| 109 | 109 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 // The window this shelf belongs to. | 150 // The window this shelf belongs to. |
| 151 BrowserView* parent_; | 151 BrowserView* parent_; |
| 152 | 152 |
| 153 views::MouseWatcher mouse_watcher_; | 153 views::MouseWatcher mouse_watcher_; |
| 154 | 154 |
| 155 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); | 155 DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_SHELF_VIEW_H_ | 158 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_SHELF_VIEW_H_ |
| OLD | NEW |