| 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, |
| 835 !chrome::IsTabAudioMuted(contents), |
| 836 chrome::kUserMuteToggleCause); |
| 835 } | 837 } |
| 836 | 838 |
| 837 // Called when the user closes a tab. Asks the model to close the tab. |sender| | 839 // Called when the user closes a tab. Asks the model to close the tab. |sender| |
| 838 // is the TabView that is potentially going away. | 840 // is the TabView that is potentially going away. |
| 839 - (void)closeTab:(id)sender { | 841 - (void)closeTab:(id)sender { |
| 840 DCHECK([sender isKindOfClass:[TabView class]]); | 842 DCHECK([sender isKindOfClass:[TabView class]]); |
| 841 | 843 |
| 842 // Cancel any pending tab transition. | 844 // Cancel any pending tab transition. |
| 843 hoverTabSelector_->CancelTabTransition(); | 845 hoverTabSelector_->CancelTabTransition(); |
| 844 | 846 |
| (...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 | 2316 // 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 | 2317 // the devtools view is always in the hierarchy even if it is not open or it |
| 2316 // is detached. | 2318 // is detached. |
| 2317 NSView* devtools_view = [[[view superview] superview] superview]; | 2319 NSView* devtools_view = [[[view superview] superview] superview]; |
| 2318 if (devtools_view) { | 2320 if (devtools_view) { |
| 2319 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; | 2321 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; |
| 2320 } else { | 2322 } else { |
| 2321 return [view convertRect:[view bounds] toView:nil]; | 2323 return [view convertRect:[view bounds] toView:nil]; |
| 2322 } | 2324 } |
| 2323 } | 2325 } |
| OLD | NEW |