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/monitor/tray_monitor.h" | 5 #include "ash/system/monitor/tray_monitor.h" |
6 | 6 |
7 #include "ash/gpu_support.h" | 7 #include "ash/gpu_support.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/tray/tray_item_view.h" | 9 #include "ash/system/tray/tray_item_view.h" |
10 #include "base/process/memory.h" | 10 #include "base/process/memory.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 TrayItemView* view = new TrayItemView(this); | 38 TrayItemView* view = new TrayItemView(this); |
39 view->CreateLabel(); | 39 view->CreateLabel(); |
40 label_ = view->label(); | 40 label_ = view->label(); |
41 label_->SetAutoColorReadabilityEnabled(false); | 41 label_->SetAutoColorReadabilityEnabled(false); |
42 label_->SetEnabledColor(SK_ColorWHITE); | 42 label_->SetEnabledColor(SK_ColorWHITE); |
43 label_->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); | 43 label_->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); |
44 label_->SetShadowColors(SkColorSetARGB(64, 0, 0, 0), | 44 label_->SetShadowColors(SkColorSetARGB(64, 0, 0, 0), |
45 SkColorSetARGB(64, 0, 0, 0)); | 45 SkColorSetARGB(64, 0, 0, 0)); |
46 label_->SetShadowOffset(0, 1); | 46 label_->SetShadowOffset(0, 1); |
47 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 47 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
48 label_->SetFontList(label_->font_list().DeriveFontListWithSizeDelta(-2)); | 48 label_->SetFontList(label_->font_list().DeriveWithSizeDelta(-2)); |
49 return view; | 49 return view; |
50 } | 50 } |
51 | 51 |
52 void TrayMonitor::DestroyTrayView() { | 52 void TrayMonitor::DestroyTrayView() { |
53 label_ = NULL; | 53 label_ = NULL; |
54 } | 54 } |
55 | 55 |
56 void TrayMonitor::OnTimer() { | 56 void TrayMonitor::OnTimer() { |
57 GPUSupport::GetGpuProcessHandlesCallback callback = | 57 GPUSupport::GetGpuProcessHandlesCallback callback = |
58 base::Bind(&TrayMonitor::OnGotHandles, base::Unretained(this)); | 58 base::Bind(&TrayMonitor::OnGotHandles, base::Unretained(this)); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 base::UTF16ToUTF8(private_size).c_str(), | 94 base::UTF16ToUTF8(private_size).c_str(), |
95 base::UTF16ToUTF8(shared_size).c_str()); | 95 base::UTF16ToUTF8(shared_size).c_str()); |
96 label_->SetText(base::UTF8ToUTF16(output)); | 96 label_->SetText(base::UTF8ToUTF16(output)); |
97 refresh_timer_.Start(FROM_HERE, | 97 refresh_timer_.Start(FROM_HERE, |
98 base::TimeDelta::FromMilliseconds(kRefreshTimeoutMs), | 98 base::TimeDelta::FromMilliseconds(kRefreshTimeoutMs), |
99 this, &TrayMonitor::OnTimer); | 99 this, &TrayMonitor::OnTimer); |
100 } | 100 } |
101 | 101 |
102 } // namespace internal | 102 } // namespace internal |
103 } // namespace ash | 103 } // namespace ash |
OLD | NEW |