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

Side by Side Diff: chrome/browser/ui/tabs/tab_utils.cc

Issue 815363002: replace COMPILE_ASSERT with static_assert in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 12 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
OLDNEW
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 9 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
10 #include "chrome/browser/media/media_stream_capture_indicator.h" 10 #include "chrome/browser/media/media_stream_capture_indicator.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 double TabRecordingIndicatorAnimation::GetCurrentValue() const { 56 double TabRecordingIndicatorAnimation::GetCurrentValue() const {
57 return current_part_index() % 2 ? 57 return current_part_index() % 2 ?
58 1.0 - MultiAnimation::GetCurrentValue() : 58 1.0 - MultiAnimation::GetCurrentValue() :
59 MultiAnimation::GetCurrentValue(); 59 MultiAnimation::GetCurrentValue();
60 } 60 }
61 61
62 scoped_ptr<TabRecordingIndicatorAnimation> 62 scoped_ptr<TabRecordingIndicatorAnimation>
63 TabRecordingIndicatorAnimation::Create() { 63 TabRecordingIndicatorAnimation::Create() {
64 MultiAnimation::Parts parts; 64 MultiAnimation::Parts parts;
65 COMPILE_ASSERT(kCaptureIndicatorThrobCycles % 2 != 0, 65 static_assert(kCaptureIndicatorThrobCycles % 2 != 0,
66 must_be_odd_so_animation_finishes_in_showing_state); 66 "odd number of cycles required so animation finishes in showing state");
67 for (int i = 0; i < kCaptureIndicatorThrobCycles; ++i) { 67 for (int i = 0; i < kCaptureIndicatorThrobCycles; ++i) {
68 parts.push_back(MultiAnimation::Part( 68 parts.push_back(MultiAnimation::Part(
69 i % 2 ? kIndicatorFadeOutDurationMs : kIndicatorFadeInDurationMs, 69 i % 2 ? kIndicatorFadeOutDurationMs : kIndicatorFadeInDurationMs,
70 gfx::Tween::EASE_IN)); 70 gfx::Tween::EASE_IN));
71 } 71 }
72 const base::TimeDelta interval = 72 const base::TimeDelta interval =
73 base::TimeDelta::FromMilliseconds(kIndicatorFrameIntervalMs); 73 base::TimeDelta::FromMilliseconds(kIndicatorFrameIntervalMs);
74 scoped_ptr<TabRecordingIndicatorAnimation> animation( 74 scoped_ptr<TabRecordingIndicatorAnimation> animation(
75 new TabRecordingIndicatorAnimation(parts, interval)); 75 new TabRecordingIndicatorAnimation(parts, interval));
76 animation->set_continuous(false); 76 animation->set_continuous(false);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 const std::vector<int>& indices) { 266 const std::vector<int>& indices) {
267 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end(); 267 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end();
268 ++i) { 268 ++i) {
269 if (!IsTabAudioMuted(tab_strip.GetWebContentsAt(*i))) 269 if (!IsTabAudioMuted(tab_strip.GetWebContentsAt(*i)))
270 return false; 270 return false;
271 } 271 }
272 return true; 272 return true;
273 } 273 }
274 274
275 } // namespace chrome 275 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698