| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/download_item_controller.h" | 5 #import "chrome/browser/cocoa/download_item_controller.h" |
| 6 | 6 |
| 7 #include "app/gfx/text_elider.h" | 7 #include "app/gfx/text_elider.h" |
| 8 #include "app/l10n_util_mac.h" | 8 #include "app/l10n_util_mac.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 [progressView_ setHidden:NO]; | 231 [progressView_ setHidden:NO]; |
| 232 [dangerousDownloadView_ setHidden:YES]; | 232 [dangerousDownloadView_ setHidden:YES]; |
| 233 } else { | 233 } else { |
| 234 DCHECK_EQ(kDangerous, state_); | 234 DCHECK_EQ(kDangerous, state_); |
| 235 [progressView_ setHidden:YES]; | 235 [progressView_ setHidden:YES]; |
| 236 [dangerousDownloadView_ setHidden:NO]; | 236 [dangerousDownloadView_ setHidden:NO]; |
| 237 } | 237 } |
| 238 [shelf_ layoutItems]; | 238 [shelf_ layoutItems]; |
| 239 } | 239 } |
| 240 | 240 |
| 241 // Called after the current theme has changed. |
| 241 - (void)themeDidChangeNotification:(NSNotification*)aNotification { | 242 - (void)themeDidChangeNotification:(NSNotification*)aNotification { |
| 242 GTMTheme* theme = [aNotification object]; | 243 GTMTheme* theme = [aNotification object]; |
| 243 [self updateTheme:theme]; | 244 [self updateTheme:theme]; |
| 244 } | 245 } |
| 245 | 246 |
| 247 // Adapt appearance to the current theme. Called after theme changes and before |
| 248 // this is shown for the first time. |
| 246 - (void)updateTheme:(GTMTheme*)theme { | 249 - (void)updateTheme:(GTMTheme*)theme { |
| 247 NSColor* color = [theme textColorForStyle:GTMThemeStyleTabBarSelected | 250 NSColor* color = [theme textColorForStyle:GTMThemeStyleTabBarSelected |
| 248 state:GTMThemeStateActiveWindow]; | 251 state:GTMThemeStateActiveWindow]; |
| 249 [dangerousDownloadLabel_ setTextColor:color]; | 252 [dangerousDownloadLabel_ setTextColor:color]; |
| 250 } | 253 } |
| 251 | 254 |
| 252 - (IBAction)saveDownload:(id)sender { | 255 - (IBAction)saveDownload:(id)sender { |
| 253 // The user has confirmed a dangerous download. We record how quickly the | 256 // The user has confirmed a dangerous download. We record how quickly the |
| 254 // user did this to detect whether we're being clickjacked. | 257 // user did this to detect whether we're being clickjacked. |
| 255 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", | 258 UMA_HISTOGRAM_LONG_TIMES("clickjacking.save_download", |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 313 |
| 311 - (IBAction)handleReveal:(id)sender { | 314 - (IBAction)handleReveal:(id)sender { |
| 312 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::SHOW_IN_FOLDER); | 315 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::SHOW_IN_FOLDER); |
| 313 } | 316 } |
| 314 | 317 |
| 315 - (IBAction)handleCancel:(id)sender { | 318 - (IBAction)handleCancel:(id)sender { |
| 316 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::CANCEL); | 319 menuBridge_->ExecuteItemCommand(DownloadShelfContextMenuMac::CANCEL); |
| 317 } | 320 } |
| 318 | 321 |
| 319 @end | 322 @end |
| OLD | NEW |