OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/tabs/alert_indicator_button_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 - (void)removeFromSuperview { | 71 - (void)removeFromSuperview { |
72 fadeAnimation_.reset(); | 72 fadeAnimation_.reset(); |
73 [super removeFromSuperview]; | 73 [super removeFromSuperview]; |
74 } | 74 } |
75 | 75 |
76 - (void)updateIconForState:(TabAlertState)aState { | 76 - (void)updateIconForState:(TabAlertState)aState { |
77 if (aState != TabAlertState::NONE) { | 77 if (aState != TabAlertState::NONE) { |
78 TabView* const tabView = base::mac::ObjCCast<TabView>([self superview]); | 78 TabView* const tabView = base::mac::ObjCCast<TabView>([self superview]); |
79 SkColor iconColor = [tabView closeButtonColor]; | 79 SkColor iconColor = [tabView iconColor]; |
80 NSImage* tabIndicatorImage = | 80 NSImage* tabIndicatorImage = |
81 chrome::GetTabAlertIndicatorImage(aState, iconColor).ToNSImage(); | 81 chrome::GetTabAlertIndicatorImage(aState, iconColor).ToNSImage(); |
82 [self setImage:tabIndicatorImage]; | 82 [self setImage:tabIndicatorImage]; |
83 affordanceImage_.reset( | 83 affordanceImage_.reset( |
84 [chrome::GetTabAlertIndicatorAffordanceImage(aState, iconColor) | 84 [chrome::GetTabAlertIndicatorAffordanceImage(aState, iconColor) |
85 .ToNSImage() retain]); | 85 .ToNSImage() retain]); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 - (void)transitionToAlertState:(TabAlertState)nextState { | 89 - (void)transitionToAlertState:(TabAlertState)nextState { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 - (void)windowDidChangeTheme { | 297 - (void)windowDidChangeTheme { |
298 // Force the alert icon to update because the icon color may change based | 298 // Force the alert icon to update because the icon color may change based |
299 // on the current theme. | 299 // on the current theme. |
300 [self updateIconForState:alertState_]; | 300 [self updateIconForState:alertState_]; |
301 } | 301 } |
302 | 302 |
303 - (void)windowDidChangeActive { | 303 - (void)windowDidChangeActive { |
304 } | 304 } |
305 | 305 |
306 @end | 306 @end |
OLD | NEW |