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 #include "chrome/browser/ui/tabs/tab_utils.h" | 5 #include "chrome/browser/ui/tabs/tab_utils.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
8 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
9 #include "build/build_config.h" | 11 #include "build/build_config.h" |
10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 12 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
11 #include "chrome/browser/media/media_stream_capture_indicator.h" | 13 #include "chrome/browser/media/media_stream_capture_indicator.h" |
12 #include "chrome/browser/themes/theme_properties.h" | 14 #include "chrome/browser/themes/theme_properties.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
16 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 for (int i = 0; i < kCaptureIndicatorThrobCycles; ++i) { | 91 for (int i = 0; i < kCaptureIndicatorThrobCycles; ++i) { |
90 parts.push_back(MultiAnimation::Part( | 92 parts.push_back(MultiAnimation::Part( |
91 i % 2 ? kIndicatorFadeOutDurationMs : kIndicatorFadeInDurationMs, | 93 i % 2 ? kIndicatorFadeOutDurationMs : kIndicatorFadeInDurationMs, |
92 gfx::Tween::EASE_IN)); | 94 gfx::Tween::EASE_IN)); |
93 } | 95 } |
94 const base::TimeDelta interval = | 96 const base::TimeDelta interval = |
95 base::TimeDelta::FromMilliseconds(kIndicatorFrameIntervalMs); | 97 base::TimeDelta::FromMilliseconds(kIndicatorFrameIntervalMs); |
96 scoped_ptr<TabRecordingIndicatorAnimation> animation( | 98 scoped_ptr<TabRecordingIndicatorAnimation> animation( |
97 new TabRecordingIndicatorAnimation(parts, interval)); | 99 new TabRecordingIndicatorAnimation(parts, interval)); |
98 animation->set_continuous(false); | 100 animation->set_continuous(false); |
99 return animation.Pass(); | 101 return animation; |
100 } | 102 } |
101 | 103 |
102 } // namespace | 104 } // namespace |
103 | 105 |
104 bool ShouldTabShowFavicon(int capacity, | 106 bool ShouldTabShowFavicon(int capacity, |
105 bool is_pinned_tab, | 107 bool is_pinned_tab, |
106 bool is_active_tab, | 108 bool is_active_tab, |
107 bool has_favicon, | 109 bool has_favicon, |
108 TabMediaState media_state) { | 110 TabMediaState media_state) { |
109 if (!has_favicon) | 111 if (!has_favicon) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 gfx::MultiAnimation::Parts parts; | 223 gfx::MultiAnimation::Parts parts; |
222 const bool is_for_fade_in = (media_state != TAB_MEDIA_STATE_NONE); | 224 const bool is_for_fade_in = (media_state != TAB_MEDIA_STATE_NONE); |
223 parts.push_back(gfx::MultiAnimation::Part( | 225 parts.push_back(gfx::MultiAnimation::Part( |
224 is_for_fade_in ? kIndicatorFadeInDurationMs : kIndicatorFadeOutDurationMs, | 226 is_for_fade_in ? kIndicatorFadeInDurationMs : kIndicatorFadeOutDurationMs, |
225 gfx::Tween::EASE_IN)); | 227 gfx::Tween::EASE_IN)); |
226 const base::TimeDelta interval = | 228 const base::TimeDelta interval = |
227 base::TimeDelta::FromMilliseconds(kIndicatorFrameIntervalMs); | 229 base::TimeDelta::FromMilliseconds(kIndicatorFrameIntervalMs); |
228 scoped_ptr<gfx::MultiAnimation> animation( | 230 scoped_ptr<gfx::MultiAnimation> animation( |
229 new gfx::MultiAnimation(parts, interval)); | 231 new gfx::MultiAnimation(parts, interval)); |
230 animation->set_continuous(false); | 232 animation->set_continuous(false); |
231 return animation.Pass(); | 233 return std::move(animation); |
232 } | 234 } |
233 | 235 |
234 base::string16 AssembleTabTooltipText(const base::string16& title, | 236 base::string16 AssembleTabTooltipText(const base::string16& title, |
235 TabMediaState media_state) { | 237 TabMediaState media_state) { |
236 if (media_state == TAB_MEDIA_STATE_NONE) | 238 if (media_state == TAB_MEDIA_STATE_NONE) |
237 return title; | 239 return title; |
238 | 240 |
239 base::string16 result = title; | 241 base::string16 result = title; |
240 if (!result.empty()) | 242 if (!result.empty()) |
241 result.append(1, '\n'); | 243 result.append(1, '\n'); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 const std::vector<int>& indices) { | 348 const std::vector<int>& indices) { |
347 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end(); | 349 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end(); |
348 ++i) { | 350 ++i) { |
349 if (!tab_strip.GetWebContentsAt(*i)->IsAudioMuted()) | 351 if (!tab_strip.GetWebContentsAt(*i)->IsAudioMuted()) |
350 return false; | 352 return false; |
351 } | 353 } |
352 return true; | 354 return true; |
353 } | 355 } |
354 | 356 |
355 } // namespace chrome | 357 } // namespace chrome |
OLD | NEW |