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 // A ChromeView that implements one download on the Download shelf. | 5 // A ChromeView that implements one download on the Download shelf. |
6 // Each DownloadItemView contains an application icon, a text label | 6 // Each DownloadItemView contains an application icon, a text label |
7 // indicating the download's file name, a text label indicating the | 7 // indicating the download's file name, a text label indicating the |
8 // download's status (such as the number of bytes downloaded so far) | 8 // download's status (such as the number of bytes downloaded so far) |
9 // and a button for canceling an in progress download, or opening | 9 // and a button for canceling an in progress download, or opening |
10 // the completed download. | 10 // the completed download. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void StartDownloadProgress(); | 67 void StartDownloadProgress(); |
68 void StopDownloadProgress(); | 68 void StopDownloadProgress(); |
69 | 69 |
70 // IconManager::Client interface. | 70 // IconManager::Client interface. |
71 void OnExtractIconComplete(gfx::Image* icon); | 71 void OnExtractIconComplete(gfx::Image* icon); |
72 | 72 |
73 // Returns the DownloadItem model object belonging to this item. | 73 // Returns the DownloadItem model object belonging to this item. |
74 content::DownloadItem* download() { return model_.download(); } | 74 content::DownloadItem* download() { return model_.download(); } |
75 | 75 |
76 // DownloadItem::Observer methods | 76 // DownloadItem::Observer methods |
77 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 77 virtual void OnDownloadUpdated(content::DownloadItem* download) override; |
78 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; | 78 virtual void OnDownloadOpened(content::DownloadItem* download) override; |
79 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; | 79 virtual void OnDownloadDestroyed(content::DownloadItem* download) override; |
80 | 80 |
81 // Overridden from views::View: | 81 // Overridden from views::View: |
82 virtual void Layout() OVERRIDE; | 82 virtual void Layout() override; |
83 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 83 virtual gfx::Size GetPreferredSize() const override; |
84 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 84 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
85 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 85 virtual bool OnMouseDragged(const ui::MouseEvent& event) override; |
86 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 86 virtual void OnMouseReleased(const ui::MouseEvent& event) override; |
87 virtual void OnMouseCaptureLost() OVERRIDE; | 87 virtual void OnMouseCaptureLost() override; |
88 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 88 virtual void OnMouseMoved(const ui::MouseEvent& event) override; |
89 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 89 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
90 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 90 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
91 virtual bool GetTooltipText(const gfx::Point& p, | 91 virtual bool GetTooltipText(const gfx::Point& p, |
92 base::string16* tooltip) const OVERRIDE; | 92 base::string16* tooltip) const override; |
93 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 93 virtual void GetAccessibleState(ui::AXViewState* state) override; |
94 virtual void OnThemeChanged() OVERRIDE; | 94 virtual void OnThemeChanged() override; |
95 | 95 |
96 // Overridden from ui::EventHandler: | 96 // Overridden from ui::EventHandler: |
97 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 97 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
98 | 98 |
99 // Overridden from views::ContextMenuController. | 99 // Overridden from views::ContextMenuController. |
100 virtual void ShowContextMenuForView(View* source, | 100 virtual void ShowContextMenuForView(View* source, |
101 const gfx::Point& point, | 101 const gfx::Point& point, |
102 ui::MenuSourceType source_type) OVERRIDE; | 102 ui::MenuSourceType source_type) override; |
103 | 103 |
104 // ButtonListener implementation. | 104 // ButtonListener implementation. |
105 virtual void ButtonPressed(views::Button* sender, | 105 virtual void ButtonPressed(views::Button* sender, |
106 const ui::Event& event) OVERRIDE; | 106 const ui::Event& event) override; |
107 | 107 |
108 // gfx::AnimationDelegate implementation. | 108 // gfx::AnimationDelegate implementation. |
109 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 109 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
110 | 110 |
111 protected: | 111 protected: |
112 // Overridden from views::View: | 112 // Overridden from views::View: |
113 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 113 virtual void OnPaint(gfx::Canvas* canvas) override; |
114 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; | 114 virtual void OnPaintBackground(gfx::Canvas* canvas) override; |
115 virtual void OnFocus() OVERRIDE; | 115 virtual void OnFocus() override; |
116 virtual void OnBlur() OVERRIDE; | 116 virtual void OnBlur() override; |
117 | 117 |
118 private: | 118 private: |
119 enum State { | 119 enum State { |
120 NORMAL = 0, | 120 NORMAL = 0, |
121 HOT, | 121 HOT, |
122 PUSHED | 122 PUSHED |
123 }; | 123 }; |
124 | 124 |
125 enum Mode { | 125 enum Mode { |
126 NORMAL_MODE = 0, // Showing download item. | 126 NORMAL_MODE = 0, // Showing download item. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; | 344 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; |
345 | 345 |
346 // Method factory used to delay reenabling of the item when opening the | 346 // Method factory used to delay reenabling of the item when opening the |
347 // downloaded file. | 347 // downloaded file. |
348 base::WeakPtrFactory<DownloadItemView> weak_ptr_factory_; | 348 base::WeakPtrFactory<DownloadItemView> weak_ptr_factory_; |
349 | 349 |
350 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); | 350 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); |
351 }; | 351 }; |
352 | 352 |
353 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ | 353 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ |
OLD | NEW |