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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_controller.mm

Issue 2209443005: [Mac] Refactor for updating the download item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "chrome/browser/ui/cocoa/download/download_item_controller.h" 5 #import "chrome/browser/ui/cocoa/download/download_item_controller.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 - (ui::MenuModel*)contextMenuModel { 277 - (ui::MenuModel*)contextMenuModel {
278 return menuBridge_->GetMenuModel(); 278 return menuBridge_->GetMenuModel();
279 } 279 }
280 280
281 - (void)updateToolTip { 281 - (void)updateToolTip {
282 base::string16 tooltip_text = 282 base::string16 tooltip_text =
283 bridge_->download_model()->GetTooltipText(*font_list_, kToolTipMaxWidth); 283 bridge_->download_model()->GetTooltipText(*font_list_, kToolTipMaxWidth);
284 [progressView_ setToolTip:base::SysUTF16ToNSString(tooltip_text)]; 284 [progressView_ setToolTip:base::SysUTF16ToNSString(tooltip_text)];
285 } 285 }
286 286
287 - (void)updateDownloadItemView {
288 [progressView_ setNeedsDisplay:YES];
289 }
290
291 - (void)clearDangerousMode { 287 - (void)clearDangerousMode {
292 [self setState:kNormal]; 288 [self setState:kNormal];
293 // The state change hide the dangerouse download view and is now showing the 289 // The state change hide the dangerouse download view and is now showing the
294 // download progress view. This means the view is likely to be a different 290 // download progress view. This means the view is likely to be a different
295 // size, so trigger a shelf layout to fix up spacing. 291 // size, so trigger a shelf layout to fix up spacing.
296 [shelf_ layoutItems]; 292 [shelf_ layoutItems];
297 } 293 }
298 294
299 - (BOOL)isDangerousMode { 295 - (BOOL)isDangerousMode {
300 return state_ == kDangerous; 296 return state_ == kDangerous;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 DownloadItem* download = bridge_->download_model()->download(); 360 DownloadItem* download = bridge_->download_model()->download();
365 download->Remove(); 361 download->Remove();
366 // WARNING: we are deleted at this point. Don't access 'this'. 362 // WARNING: we are deleted at this point. Don't access 'this'.
367 } 363 }
368 364
369 - (IBAction)showContextMenu:(id)sender { 365 - (IBAction)showContextMenu:(id)sender {
370 [progressView_ showContextMenu]; 366 [progressView_ showContextMenu];
371 } 367 }
372 368
373 @end 369 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698