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 #ifndef CHROME_BROWSER_UI_TABS_TAB_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_TABS_TAB_UTILS_H_ |
6 #define CHROME_BROWSER_UI_TABS_TAB_UTILS_H_ | 6 #define CHROME_BROWSER_UI_TABS_TAB_UTILS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // | 39 // |
40 // Precedence rules for deciding what to show when capacity is insufficient to | 40 // Precedence rules for deciding what to show when capacity is insufficient to |
41 // show everything: | 41 // show everything: |
42 // | 42 // |
43 // Active tab: Always show the close button, then the media indicator, then | 43 // Active tab: Always show the close button, then the media indicator, then |
44 // the favicon. | 44 // the favicon. |
45 // Inactive tab: Media indicator, then the favicon, then the close button. | 45 // Inactive tab: Media indicator, then the favicon, then the close button. |
46 // Pinned tab: Show only the media indicator, or only the favicon | 46 // Pinned tab: Show only the media indicator, or only the favicon |
47 // (TAB_MEDIA_STATE_NONE). Never show the close button. | 47 // (TAB_MEDIA_STATE_NONE). Never show the close button. |
48 bool ShouldTabShowFavicon(int capacity, | 48 bool ShouldTabShowFavicon(int capacity, |
| 49 int width, |
| 50 bool touch_used_last, |
49 bool is_pinned_tab, | 51 bool is_pinned_tab, |
50 bool is_active_tab, | 52 bool is_active_tab, |
51 bool has_favicon, | 53 bool has_favicon, |
52 TabMediaState media_state); | 54 TabMediaState media_state); |
53 bool ShouldTabShowMediaIndicator(int capacity, | 55 bool ShouldTabShowMediaIndicator(int capacity, |
| 56 int width, |
| 57 bool touch_used_last, |
54 bool is_pinned_tab, | 58 bool is_pinned_tab, |
55 bool is_active_tab, | 59 bool is_active_tab, |
56 bool has_favicon, | 60 bool has_favicon, |
57 TabMediaState media_state); | 61 TabMediaState media_state); |
58 bool ShouldTabShowCloseButton(int capacity, | 62 bool ShouldTabShowCloseButton(int capacity, |
| 63 int width, |
| 64 bool touch_used_last, |
59 bool is_pinned_tab, | 65 bool is_pinned_tab, |
60 bool is_active_tab); | 66 bool is_active_tab); |
61 | 67 |
62 // Returns whether the given |contents| is playing audio. We might choose to | 68 // Returns whether the given |contents| is playing audio. We might choose to |
63 // show an audio favicon indicator for this tab. | 69 // show an audio favicon indicator for this tab. |
64 bool IsPlayingAudio(content::WebContents* contents); | 70 bool IsPlayingAudio(content::WebContents* contents); |
65 | 71 |
66 // Returns the media state to be shown by the tab's media indicator. When | 72 // Returns the media state to be shown by the tab's media indicator. When |
67 // multiple states apply (e.g., tab capture with audio playback), the one most | 73 // multiple states apply (e.g., tab capture with audio playback), the one most |
68 // relevant to user privacy concerns is selected. | 74 // relevant to user privacy concerns is selected. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 bool IsTabAudioMuted(content::WebContents* contents); | 107 bool IsTabAudioMuted(content::WebContents* contents); |
102 void SetTabAudioMuted(content::WebContents* contents, bool mute); | 108 void SetTabAudioMuted(content::WebContents* contents, bool mute); |
103 | 109 |
104 // Returns true if the tabs at the |indices| in |tab_strip| are all muted. | 110 // Returns true if the tabs at the |indices| in |tab_strip| are all muted. |
105 bool AreAllTabsMuted(const TabStripModel& tab_strip, | 111 bool AreAllTabsMuted(const TabStripModel& tab_strip, |
106 const std::vector<int>& indices); | 112 const std::vector<int>& indices); |
107 | 113 |
108 } // namespace chrome | 114 } // namespace chrome |
109 | 115 |
110 #endif // CHROME_BROWSER_UI_TABS_TAB_UTILS_H_ | 116 #endif // CHROME_BROWSER_UI_TABS_TAB_UTILS_H_ |
OLD | NEW |