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

Side by Side Diff: chrome/browser/ui/views/download/download_item_view.h

Issue 1538773002: Reduce CPU usage of download shelf UI. (both MD and pre-MD shelves) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: warning dialog tested (fix MD only bug) Created 4 years, 11 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/ui/views/download/download_item_view.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 // 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 int width); 185 int width);
186 186
187 // Sets the state and triggers a repaint. 187 // Sets the state and triggers a repaint.
188 void SetState(State body_state, State drop_down_state); 188 void SetState(State body_state, State drop_down_state);
189 189
190 // Whether we are in the dangerous mode. 190 // Whether we are in the dangerous mode.
191 bool IsShowingWarningDialog() const { 191 bool IsShowingWarningDialog() const {
192 return mode_ == DANGEROUS_MODE || mode_ == MALICIOUS_MODE; 192 return mode_ == DANGEROUS_MODE || mode_ == MALICIOUS_MODE;
193 } 193 }
194 194
195 // Clears or shows the warning dialog as per the state of |model_|.
196 void ToggleWarningDialog();
197
195 // Reverts from dangerous mode to normal download mode. 198 // Reverts from dangerous mode to normal download mode.
196 void ClearWarningDialog(); 199 void ClearWarningDialog();
197 200
198 // Start displaying the dangerous download warning or the malicious download 201 // Start displaying the dangerous download warning or the malicious download
199 // warning. 202 // warning.
200 void ShowWarningDialog(); 203 void ShowWarningDialog();
201 204
202 // Sets |size| with the size of the Save and Discard buttons (they have the 205 // Sets |size| with the size of the Save and Discard buttons (they have the
203 // same size). 206 // same size).
204 gfx::Size GetButtonSize() const; 207 gfx::Size GetButtonSize() const;
(...skipping 20 matching lines...) Expand all
225 void UpdateAccessibleName(); 228 void UpdateAccessibleName();
226 229
227 // Update the location of the drop down button. 230 // Update the location of the drop down button.
228 void UpdateDropDownButtonPosition(); 231 void UpdateDropDownButtonPosition();
229 232
230 // Show/Hide/Reset |animation| based on the state transition specified by 233 // Show/Hide/Reset |animation| based on the state transition specified by
231 // |from| and |to|. 234 // |from| and |to|.
232 void AnimateStateTransition(State from, State to, 235 void AnimateStateTransition(State from, State to,
233 gfx::SlideAnimation* animation); 236 gfx::SlideAnimation* animation);
234 237
238 // Callback for |progress_timer_|.
239 void ProgressTimerFired();
240
235 // The different images used for the background. 241 // The different images used for the background.
236 BodyImageSet normal_body_image_set_; 242 BodyImageSet normal_body_image_set_;
237 BodyImageSet hot_body_image_set_; 243 BodyImageSet hot_body_image_set_;
238 BodyImageSet pushed_body_image_set_; 244 BodyImageSet pushed_body_image_set_;
239 BodyImageSet dangerous_mode_body_image_set_; 245 BodyImageSet dangerous_mode_body_image_set_;
240 BodyImageSet malicious_mode_body_image_set_; 246 BodyImageSet malicious_mode_body_image_set_;
241 DropDownImageSet normal_drop_down_image_set_; 247 DropDownImageSet normal_drop_down_image_set_;
242 DropDownImageSet hot_drop_down_image_set_; 248 DropDownImageSet hot_drop_down_image_set_;
243 DropDownImageSet pushed_drop_down_image_set_; 249 DropDownImageSet pushed_drop_down_image_set_;
244 250
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; 354 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_;
349 355
350 // Method factory used to delay reenabling of the item when opening the 356 // Method factory used to delay reenabling of the item when opening the
351 // downloaded file. 357 // downloaded file.
352 base::WeakPtrFactory<DownloadItemView> weak_ptr_factory_; 358 base::WeakPtrFactory<DownloadItemView> weak_ptr_factory_;
353 359
354 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); 360 DISALLOW_COPY_AND_ASSIGN(DownloadItemView);
355 }; 361 };
356 362
357 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ 363 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698