| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/common/system/chromeos/brightness/tray_brightness.h" | 5 #include "ash/common/system/chromeos/brightness/tray_brightness.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 icon->SetImage( | 110 icon->SetImage( |
| 111 gfx::CreateVectorIcon(kSystemMenuBrightnessIcon, kMenuIconColor)); | 111 gfx::CreateVectorIcon(kSystemMenuBrightnessIcon, kMenuIconColor)); |
| 112 } else { | 112 } else { |
| 113 icon->SetImage( | 113 icon->SetImage( |
| 114 rb.GetImageNamed(IDR_AURA_UBER_TRAY_BRIGHTNESS).ToImageSkia()); | 114 rb.GetImageNamed(IDR_AURA_UBER_TRAY_BRIGHTNESS).ToImageSkia()); |
| 115 } | 115 } |
| 116 AddChildView(icon); | 116 AddChildView(icon); |
| 117 slider_ = views::Slider::CreateSlider( | 117 slider_ = views::Slider::CreateSlider( |
| 118 ash::MaterialDesignController::IsSystemTrayMenuMaterial(), this); | 118 ash::MaterialDesignController::IsSystemTrayMenuMaterial(), this); |
| 119 if (ash::MaterialDesignController::IsSystemTrayMenuMaterial()) { | 119 if (ash::MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 120 slider_->SetBorder(views::Border::CreateEmptyBorder( | 120 slider_->SetBorder(views::CreateEmptyBorder( |
| 121 gfx::Insets(0, kTrayPopupSliderPaddingMD) + slider_->GetInsets())); | 121 gfx::Insets(0, kTrayPopupSliderPaddingMD) + slider_->GetInsets())); |
| 122 } | 122 } |
| 123 slider_->set_focus_border_color(kFocusBorderColor); | 123 slider_->set_focus_border_color(kFocusBorderColor); |
| 124 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); | 124 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); |
| 125 slider_->SetAccessibleName( | 125 slider_->SetAccessibleName( |
| 126 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BRIGHTNESS)); | 126 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BRIGHTNESS)); |
| 127 AddChildView(slider_); | 127 AddChildView(slider_); |
| 128 | 128 |
| 129 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 129 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 130 SetVisible(true); | 130 SetVisible(true); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (!display::Display::HasInternalDisplay()) | 291 if (!display::Display::HasInternalDisplay()) |
| 292 return; | 292 return; |
| 293 | 293 |
| 294 if (brightness_view_) | 294 if (brightness_view_) |
| 295 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 295 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
| 296 else | 296 else |
| 297 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 297 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace ash | 300 } // namespace ash |
| OLD | NEW |