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

Unified Diff: ash/common/system/audio/volume_view.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/audio/volume_view.cc
diff --git a/ash/common/system/audio/volume_view.cc b/ash/common/system/audio/volume_view.cc
index c7f833fee865576cc9793b54c342c521d5b191ca..786910a82dd50a321a228b89fd7c8daa86a2d257 100644
--- a/ash/common/system/audio/volume_view.cc
+++ b/ash/common/system/audio/volume_view.cc
@@ -46,8 +46,8 @@ namespace tray {
class VolumeButton : public views::ToggleImageButton {
public:
- VolumeButton(views::ButtonListener* listener,
- system::TrayAudioDelegate* audio_delegate)
+ VolumeButton(views::ButtonListener* listener,
+ system::TrayAudioDelegate* audio_delegate)
: views::ToggleImageButton(listener),
audio_delegate_(audio_delegate),
image_index_(-1) {
@@ -62,13 +62,15 @@ class VolumeButton : public views::ToggleImageButton {
void Update() {
float level =
static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f;
- int image_index = audio_delegate_->IsOutputAudioMuted() ?
- 0 : (level == 1.0 ?
- kVolumeLevels :
- std::max(1, int(std::ceil(level * (kVolumeLevels - 1)))));
+ int image_index =
+ audio_delegate_->IsOutputAudioMuted()
+ ? 0
+ : (level == 1.0
+ ? kVolumeLevels
+ : std::max(1, int(std::ceil(level * (kVolumeLevels - 1)))));
if (image_index != image_index_) {
- gfx::Rect region(0, image_index * kVolumeImageHeight,
- kVolumeImageWidth, kVolumeImageHeight);
+ gfx::Rect region(0, image_index * kVolumeImageHeight, kVolumeImageWidth,
+ kVolumeImageHeight);
gfx::ImageSkia image_skia = gfx::ImageSkiaOperations::ExtractSubset(
*(image_.ToImageSkia()), region);
SetImage(views::CustomButton::STATE_NORMAL, &image_skia);
@@ -150,8 +152,9 @@ VolumeView::VolumeView(SystemTrayItem* owner,
more_ = new views::ImageView;
more_->EnableCanvasFlippingForRTLUI(true);
- more_->SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_AURA_UBER_TRAY_MORE).ToImageSkia());
+ more_->SetImage(ui::ResourceBundle::GetSharedInstance()
+ .GetImageNamed(IDR_AURA_UBER_TRAY_MORE)
+ .ToImageSkia());
more_region_->AddChildView(more_);
set_background(views::Background::CreateSolidBackground(kBackgroundColor));
@@ -159,8 +162,7 @@ VolumeView::VolumeView(SystemTrayItem* owner,
Update();
}
-VolumeView::~VolumeView() {
-}
+VolumeView::~VolumeView() {}
void VolumeView::Update() {
icon_->Update();
@@ -174,7 +176,7 @@ void VolumeView::SetVolumeLevel(float percent) {
// there will be a small discrepancy between slider's value and volume level
// on audio side. To avoid the jittering in slider UI, do not set change
// slider value if the change is less than 1%.
- if (std::abs(percent-slider_->value()) < 0.01)
+ if (std::abs(percent - slider_->value()) < 0.01)
return;
slider_->SetValue(percent);
// It is possible that the volume was (un)muted, but the actual volume level
@@ -200,9 +202,9 @@ void VolumeView::UpdateDeviceTypeAndMore() {
int device_icon = audio_delegate_->GetActiveOutputDeviceIconId();
if (device_icon != system::TrayAudioDelegate::kNoAudioDeviceIcon) {
device_type_->SetVisible(true);
- device_type_->SetImage(
- ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- device_icon).ToImageSkia());
+ device_type_->SetImage(ui::ResourceBundle::GetSharedInstance()
+ .GetImageNamed(device_icon)
+ .ToImageSkia());
more_region_->SetLayoutManager(new views::BoxLayout(
views::BoxLayout::kHorizontal, 0, 0, kTrayPopupPaddingBetweenItems));
} else {
« no previous file with comments | « ash/common/system/audio/tray_audio_delegate.h ('k') | ash/common/system/chromeos/enterprise/enterprise_domain_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698