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

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

Issue 389016: Address post-commit comments from codereview.chromium.org/371059 and codereview.chromium.org/293019 (Closed)
Patch Set: Created 11 years, 1 month 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 (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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/chrome_browser_window.mm ('k') | chrome/browser/cocoa/download_shelf_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698