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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/media_indicator_button_cocoa.mm

Issue 1354823002: Render the tab close button as a vector-based icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 months 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
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/ui/tabs/tab_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/media_indicator_button_cocoa.h" 5 #import "chrome/browser/ui/cocoa/tabs/media_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/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" 10 #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 fadeAnimation_.reset(); 70 fadeAnimation_.reset();
71 [super removeFromSuperview]; 71 [super removeFromSuperview];
72 } 72 }
73 73
74 - (void)transitionToMediaState:(TabMediaState)nextState { 74 - (void)transitionToMediaState:(TabMediaState)nextState {
75 if (nextState == mediaState_) 75 if (nextState == mediaState_)
76 return; 76 return;
77 77
78 if (nextState != TAB_MEDIA_STATE_NONE) { 78 if (nextState != TAB_MEDIA_STATE_NONE) {
79 [self 79 [self
80 setImage:chrome::GetTabMediaIndicatorImage(nextState, nil).ToNSImage()]; 80 setImage:chrome::GetTabMediaIndicatorImage(nextState, 0).ToNSImage()];
81 affordanceImage_.reset( 81 affordanceImage_.reset(
82 [chrome::GetTabMediaIndicatorAffordanceImage(nextState, nil) 82 [chrome::GetTabMediaIndicatorAffordanceImage(nextState, 0)
83 .ToNSImage() retain]); 83 .ToNSImage() retain]);
84 } 84 }
85 85
86 if ((mediaState_ == TAB_MEDIA_STATE_AUDIO_PLAYING && 86 if ((mediaState_ == TAB_MEDIA_STATE_AUDIO_PLAYING &&
87 nextState == TAB_MEDIA_STATE_AUDIO_MUTING) || 87 nextState == TAB_MEDIA_STATE_AUDIO_MUTING) ||
88 (mediaState_ == TAB_MEDIA_STATE_AUDIO_MUTING && 88 (mediaState_ == TAB_MEDIA_STATE_AUDIO_MUTING &&
89 nextState == TAB_MEDIA_STATE_AUDIO_PLAYING) || 89 nextState == TAB_MEDIA_STATE_AUDIO_PLAYING) ||
90 (mediaState_ == TAB_MEDIA_STATE_AUDIO_MUTING && 90 (mediaState_ == TAB_MEDIA_STATE_AUDIO_MUTING &&
91 nextState == TAB_MEDIA_STATE_NONE)) { 91 nextState == TAB_MEDIA_STATE_NONE)) {
92 // Instant user feedback: No fade animation. 92 // Instant user feedback: No fade animation.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 if (enable && tabView && ([tabView state] != NSOnState)) { 230 if (enable && tabView && ([tabView state] != NSOnState)) {
231 const int requiredWidth = 231 const int requiredWidth =
232 NSWidth([self frame]) * kMinMouseSelectableAreaPercent / 100; 232 NSWidth([self frame]) * kMinMouseSelectableAreaPercent / 100;
233 enable = ([tabView widthOfLargestSelectableRegion] >= requiredWidth); 233 enable = ([tabView widthOfLargestSelectableRegion] >= requiredWidth);
234 } 234 }
235 235
236 [self setEnabled:enable]; 236 [self setEnabled:enable];
237 } 237 }
238 238
239 @end 239 @end
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/ui/tabs/tab_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698