OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/reload_button.h" | 5 #import "chrome/browser/ui/cocoa/reload_button.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/l10n_util_mac.h" | 8 #include "app/l10n_util_mac.h" |
9 #include "base/nsimage_cache_mac.h" | 9 #include "app/mac/nsimage_cache.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
11 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" | 11 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" |
12 #import "chrome/browser/ui/cocoa/view_id_util.h" | 12 #import "chrome/browser/ui/cocoa/view_id_util.h" |
13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 NSString* const kReloadImageName = @"reload_Template.pdf"; | 17 NSString* const kReloadImageName = @"reload_Template.pdf"; |
18 NSString* const kStopImageName = @"stop_Template.pdf"; | 18 NSString* const kStopImageName = @"stop_Template.pdf"; |
19 | 19 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 - (void)updateTag:(NSInteger)anInt { | 63 - (void)updateTag:(NSInteger)anInt { |
64 if ([self tag] == anInt) | 64 if ([self tag] == anInt) |
65 return; | 65 return; |
66 | 66 |
67 // Forcibly remove any stale tooltip which is being displayed. | 67 // Forcibly remove any stale tooltip which is being displayed. |
68 [self removeAllToolTips]; | 68 [self removeAllToolTips]; |
69 | 69 |
70 [self setTag:anInt]; | 70 [self setTag:anInt]; |
71 if (anInt == IDC_RELOAD) { | 71 if (anInt == IDC_RELOAD) { |
72 [self setImage:nsimage_cache::ImageNamed(kReloadImageName)]; | 72 [self setImage:app::mac::GetCachedImageWithName(kReloadImageName)]; |
73 [self setToolTip:l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_RELOAD)]; | 73 [self setToolTip:l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_RELOAD)]; |
74 } else if (anInt == IDC_STOP) { | 74 } else if (anInt == IDC_STOP) { |
75 [self setImage:nsimage_cache::ImageNamed(kStopImageName)]; | 75 [self setImage:app::mac::GetCachedImageWithName(kStopImageName)]; |
76 [self setToolTip:l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STOP)]; | 76 [self setToolTip:l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STOP)]; |
77 } else { | 77 } else { |
78 NOTREACHED(); | 78 NOTREACHED(); |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force { | 82 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force { |
83 // Can always transition to stop mode. Only transition to reload | 83 // Can always transition to stop mode. Only transition to reload |
84 // mode if forced or if the mouse isn't hovering. Otherwise, note | 84 // mode if forced or if the mouse isn't hovering. Otherwise, note |
85 // that reload mode is desired and disable the button. | 85 // that reload mode is desired and disable the button. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 + (void)setPendingReloadTimeout:(NSTimeInterval)seconds { | 160 + (void)setPendingReloadTimeout:(NSTimeInterval)seconds { |
161 kPendingReloadTimeout = seconds; | 161 kPendingReloadTimeout = seconds; |
162 } | 162 } |
163 | 163 |
164 - (NSTrackingArea*)trackingArea { | 164 - (NSTrackingArea*)trackingArea { |
165 return trackingArea_; | 165 return trackingArea_; |
166 } | 166 } |
167 | 167 |
168 @end | 168 @end |
OLD | NEW |