OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 } | 824 } |
825 } | 825 } |
826 | 826 |
827 // Called when the user clicks the tab audio indicator to mute the tab. | 827 // Called when the user clicks the tab audio indicator to mute the tab. |
828 - (void)toggleMute:(id)sender { | 828 - (void)toggleMute:(id)sender { |
829 DCHECK([sender isKindOfClass:[TabView class]]); | 829 DCHECK([sender isKindOfClass:[TabView class]]); |
830 NSInteger index = [self modelIndexForTabView:sender]; | 830 NSInteger index = [self modelIndexForTabView:sender]; |
831 if (!tabStripModel_->ContainsIndex(index)) | 831 if (!tabStripModel_->ContainsIndex(index)) |
832 return; | 832 return; |
833 WebContents* contents = tabStripModel_->GetWebContentsAt(index); | 833 WebContents* contents = tabStripModel_->GetWebContentsAt(index); |
834 chrome::SetTabAudioMuted(contents, !chrome::IsTabAudioMuted(contents)); | 834 chrome::SetTabAudioMuted(contents, !chrome::IsTabAudioMuted(contents), |
| 835 chrome::kMutedToggleCauseUser); |
835 } | 836 } |
836 | 837 |
837 // Called when the user closes a tab. Asks the model to close the tab. |sender| | 838 // Called when the user closes a tab. Asks the model to close the tab. |sender| |
838 // is the TabView that is potentially going away. | 839 // is the TabView that is potentially going away. |
839 - (void)closeTab:(id)sender { | 840 - (void)closeTab:(id)sender { |
840 DCHECK([sender isKindOfClass:[TabView class]]); | 841 DCHECK([sender isKindOfClass:[TabView class]]); |
841 | 842 |
842 // Cancel any pending tab transition. | 843 // Cancel any pending tab transition. |
843 hoverTabSelector_->CancelTabTransition(); | 844 hoverTabSelector_->CancelTabTransition(); |
844 | 845 |
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2314 // up the hierarchy to the devtools container view to avoid that. Note that | 2315 // up the hierarchy to the devtools container view to avoid that. Note that |
2315 // the devtools view is always in the hierarchy even if it is not open or it | 2316 // the devtools view is always in the hierarchy even if it is not open or it |
2316 // is detached. | 2317 // is detached. |
2317 NSView* devtools_view = [[[view superview] superview] superview]; | 2318 NSView* devtools_view = [[[view superview] superview] superview]; |
2318 if (devtools_view) { | 2319 if (devtools_view) { |
2319 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; | 2320 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; |
2320 } else { | 2321 } else { |
2321 return [view convertRect:[view bounds] toView:nil]; | 2322 return [view convertRect:[view bounds] toView:nil]; |
2322 } | 2323 } |
2323 } | 2324 } |
OLD | NEW |