| 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 "ash/system/session_length_limit/tray_session_length_limit.h" | 5 #include "ash/system/session_length_limit/tray_session_length_limit.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shelf/shelf_types.h" | 9 #include "ash/shelf/shelf_types.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Color in which the remaining session time is normally shown. | 48 // Color in which the remaining session time is normally shown. |
| 49 const SkColor kRemainingTimeColor = SK_ColorWHITE; | 49 const SkColor kRemainingTimeColor = SK_ColorWHITE; |
| 50 // Color in which the remaining session time is shown when it is expiring soon. | 50 // Color in which the remaining session time is shown when it is expiring soon. |
| 51 const SkColor kRemainingTimeExpiringSoonColor = SK_ColorRED; | 51 const SkColor kRemainingTimeExpiringSoonColor = SK_ColorRED; |
| 52 | 52 |
| 53 views::Label* CreateAndSetupLabel() { | 53 views::Label* CreateAndSetupLabel() { |
| 54 views::Label* label = new views::Label; | 54 views::Label* label = new views::Label; |
| 55 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 55 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 56 SetupLabelForTray(label); | 56 SetupLabelForTray(label); |
| 57 label->SetFontList(label->font_list().DeriveFontListWithSizeDeltaAndStyle( | 57 label->SetFontList(label->font_list().DeriveWithStyle( |
| 58 0, label->font_list().GetFontStyle() & ~gfx::Font::BOLD)); | 58 label->font_list().GetFontStyle() & ~gfx::Font::BOLD)); |
| 59 return label; | 59 return label; |
| 60 } | 60 } |
| 61 | 61 |
| 62 base::string16 IntToTwoDigitString(int value) { | 62 base::string16 IntToTwoDigitString(int value) { |
| 63 DCHECK_GE(value, 0); | 63 DCHECK_GE(value, 0); |
| 64 DCHECK_LE(value, 99); | 64 DCHECK_LE(value, 99); |
| 65 if (value < 10) | 65 if (value < 10) |
| 66 return base::ASCIIToUTF16("0") + base::IntToString16(value); | 66 return base::ASCIIToUTF16("0") + base::IntToString16(value); |
| 67 return base::IntToString16(value); | 67 return base::IntToString16(value); |
| 68 } | 68 } |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 if (tray_view_) | 380 if (tray_view_) |
| 381 tray_view_->Update(); | 381 tray_view_->Update(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 bool TraySessionLengthLimit::IsTrayViewVisibleForTest() { | 384 bool TraySessionLengthLimit::IsTrayViewVisibleForTest() { |
| 385 return tray_view_ && tray_view_->visible(); | 385 return tray_view_ && tray_view_->visible(); |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace internal | 388 } // namespace internal |
| 389 } // namespace ash | 389 } // namespace ash |
| OLD | NEW |