OLD | NEW |
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 Loading... |
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 |
287 - (void)clearDangerousMode { | 291 - (void)clearDangerousMode { |
288 [self setState:kNormal]; | 292 [self setState:kNormal]; |
289 // The state change hide the dangerouse download view and is now showing the | 293 // The state change hide the dangerouse download view and is now showing the |
290 // download progress view. This means the view is likely to be a different | 294 // download progress view. This means the view is likely to be a different |
291 // size, so trigger a shelf layout to fix up spacing. | 295 // size, so trigger a shelf layout to fix up spacing. |
292 [shelf_ layoutItems]; | 296 [shelf_ layoutItems]; |
293 } | 297 } |
294 | 298 |
295 - (BOOL)isDangerousMode { | 299 - (BOOL)isDangerousMode { |
296 return state_ == kDangerous; | 300 return state_ == kDangerous; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 [self updateExperienceSamplingEvent:ExperienceSamplingEvent::kDeny]; | 371 [self updateExperienceSamplingEvent:ExperienceSamplingEvent::kDeny]; |
368 [self remove]; | 372 [self remove]; |
369 // WARNING: we are deleted at this point. | 373 // WARNING: we are deleted at this point. |
370 } | 374 } |
371 | 375 |
372 - (IBAction)showContextMenu:(id)sender { | 376 - (IBAction)showContextMenu:(id)sender { |
373 [progressView_ showContextMenu]; | 377 [progressView_ showContextMenu]; |
374 } | 378 } |
375 | 379 |
376 @end | 380 @end |
OLD | NEW |