Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/download/download_shelf.h

Issue 2688413012: Don't animate the download shelf when entering/exiting fullscreen. (Closed)
Patch Set: Turn on animation for all tests except the one that was flaky due to animation. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_DOWNLOAD_DOWNLOAD_SHELF_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // The browser view needs to know when we are going away to properly return 88 // The browser view needs to know when we are going away to properly return
89 // the resize corner size to WebKit so that we don't draw on top of it. 89 // the resize corner size to WebKit so that we don't draw on top of it.
90 // This returns the showing state of our animation which is set to true at 90 // This returns the showing state of our animation which is set to true at
91 // the beginning Show and false at the beginning of a Hide. 91 // the beginning Show and false at the beginning of a Hide.
92 virtual bool IsShowing() const = 0; 92 virtual bool IsShowing() const = 0;
93 93
94 // Returns whether the download shelf is showing the close animation. 94 // Returns whether the download shelf is showing the close animation.
95 virtual bool IsClosing() const = 0; 95 virtual bool IsClosing() const = 0;
96 96
97 // Opens the shelf. 97 // Opens the shelf.
98 void Show(); 98 void Open();
99 99
100 // Closes the shelf. 100 // Closes the shelf.
101 void Close(CloseReason reason); 101 void Close(CloseReason reason);
102 102
103 // Hides the shelf. This closes the shelf if it is currently showing. 103 // Hides the shelf. This closes the shelf if it is currently showing.
104 void Hide(); 104 void Hide();
105 105
106 // Unhides the shelf. This will cause the shelf to be opened if it was open 106 // Unhides the shelf. This will cause the shelf to be opened if it was open
107 // when it was hidden, or was shown while it was hidden. 107 // when it was hidden, or was shown while it was hidden.
108 void Unhide(); 108 void Unhide();
109 109
110 virtual Browser* browser() const = 0; 110 virtual Browser* browser() const = 0;
111 111
112 // Returns whether the download shelf is hidden. 112 // Returns whether the download shelf is hidden.
113 bool is_hidden() { return is_hidden_; } 113 bool is_hidden() { return is_hidden_; }
114 114
115 protected: 115 protected:
116 virtual void DoAddDownload(content::DownloadItem* download) = 0; 116 virtual void DoAddDownload(content::DownloadItem* download) = 0;
117 virtual void DoShow() = 0; 117 virtual void DoOpen() = 0;
118 virtual void DoClose(CloseReason reason) = 0; 118 virtual void DoClose(CloseReason reason) = 0;
119 virtual void DoHide() = 0;
120 virtual void DoUnhide() = 0;
119 121
120 // Time delay to wait before adding a transient download to the shelf. 122 // Time delay to wait before adding a transient download to the shelf.
121 // Protected virtual for testing. 123 // Protected virtual for testing.
122 virtual base::TimeDelta GetTransientDownloadShowDelay(); 124 virtual base::TimeDelta GetTransientDownloadShowDelay();
123 125
124 // Returns the DownloadManager associated with this DownloadShelf. All 126 // Returns the DownloadManager associated with this DownloadShelf. All
125 // downloads that are shown on this shelf is expected to belong to this 127 // downloads that are shown on this shelf is expected to belong to this
126 // DownloadManager. Protected virtual for testing. 128 // DownloadManager. Protected virtual for testing.
127 virtual content::DownloadManager* GetDownloadManager(); 129 virtual content::DownloadManager* GetDownloadManager();
128 130
129 private: 131 private:
130 // Show the download on the shelf immediately. Also displayes the download 132 // Show the download on the shelf immediately. Also displayes the download
131 // started animation if necessary. 133 // started animation if necessary.
132 void ShowDownload(content::DownloadItem* download); 134 void ShowDownload(content::DownloadItem* download);
133 135
134 // Similar to ShowDownload() but refers to the download using an ID. This 136 // Similar to ShowDownload() but refers to the download using an ID. This
135 // download should belong to the DownloadManager returned by 137 // download should belong to the DownloadManager returned by
136 // GetDownloadManager(). 138 // GetDownloadManager().
137 void ShowDownloadById(int32_t download_id); 139 void ShowDownloadById(int32_t download_id);
138 140
139 bool should_show_on_unhide_; 141 bool should_show_on_unhide_;
140 bool is_hidden_; 142 bool is_hidden_;
141 base::WeakPtrFactory<DownloadShelf> weak_ptr_factory_; 143 base::WeakPtrFactory<DownloadShelf> weak_ptr_factory_;
142 }; 144 };
143 145
144 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ 146 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698