Chromium Code Reviews| 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/system/chromeos/tray_tracing.h" | 5 #include "ash/common/system/chromeos/tray_tracing.h" |
| 6 | 6 |
| 7 #include "ash/common/system/tray/actionable_view.h" | 7 #include "ash/common/system/tray/actionable_view.h" |
| 8 #include "ash/common/system/tray/fixed_sized_image_view.h" | 8 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 9 #include "ash/common/system/tray/system_tray_delegate.h" | 9 #include "ash/common/system/tray/system_tray_delegate.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| 11 #include "ash/common/system/tray/wm_system_tray_notifier.h" | |
| 11 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
| 12 #include "ash/shell.h" | |
| 13 #include "ash/system/tray/system_tray.h" | 13 #include "ash/system/tray/system_tray.h" |
|
msw
2016/06/24 02:07:11
nit: could we instead forward declare SystemTray h
James Cook
2016/06/24 16:28:17
Done.
| |
| 14 #include "ash/system/tray/system_tray_notifier.h" | |
| 15 #include "grit/ash_resources.h" | 14 #include "grit/ash_resources.h" |
| 16 #include "grit/ash_strings.h" | 15 #include "grit/ash_strings.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/gfx/image/image.h" | 17 #include "ui/gfx/image/image.h" |
| 19 #include "ui/views/controls/image_view.h" | 18 #include "ui/views/controls/image_view.h" |
| 20 #include "ui/views/controls/label.h" | 19 #include "ui/views/controls/label.h" |
| 21 #include "ui/views/layout/box_layout.h" | 20 #include "ui/views/layout/box_layout.h" |
| 22 | 21 |
| 23 namespace ash { | 22 namespace ash { |
| 24 namespace tray { | 23 namespace tray { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 } // namespace tray | 61 } // namespace tray |
| 63 | 62 |
| 64 //////////////////////////////////////////////////////////////////////////////// | 63 //////////////////////////////////////////////////////////////////////////////// |
| 65 // ash::TrayTracing | 64 // ash::TrayTracing |
| 66 | 65 |
| 67 TrayTracing::TrayTracing(SystemTray* system_tray) | 66 TrayTracing::TrayTracing(SystemTray* system_tray) |
| 68 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_TRACING), | 67 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_TRACING), |
| 69 default_(NULL) { | 68 default_(NULL) { |
| 70 DCHECK(Shell::GetInstance()->delegate()); | |
| 71 DCHECK(system_tray); | 69 DCHECK(system_tray); |
| 72 Shell::GetInstance()->system_tray_notifier()->AddTracingObserver(this); | 70 WmShell::Get()->system_tray_notifier()->AddTracingObserver(this); |
| 73 } | 71 } |
| 74 | 72 |
| 75 TrayTracing::~TrayTracing() { | 73 TrayTracing::~TrayTracing() { |
| 76 Shell::GetInstance()->system_tray_notifier()->RemoveTracingObserver(this); | 74 WmShell::Get()->system_tray_notifier()->RemoveTracingObserver(this); |
| 77 } | 75 } |
| 78 | 76 |
| 79 void TrayTracing::SetTrayIconVisible(bool visible) { | 77 void TrayTracing::SetTrayIconVisible(bool visible) { |
| 80 if (tray_view()) | 78 if (tray_view()) |
| 81 tray_view()->SetVisible(visible); | 79 tray_view()->SetVisible(visible); |
| 82 } | 80 } |
| 83 | 81 |
| 84 bool TrayTracing::GetInitialVisibility() { | 82 bool TrayTracing::GetInitialVisibility() { |
| 85 return false; | 83 return false; |
| 86 } | 84 } |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 101 } | 99 } |
| 102 | 100 |
| 103 void TrayTracing::DestroyDetailedView() { | 101 void TrayTracing::DestroyDetailedView() { |
| 104 } | 102 } |
| 105 | 103 |
| 106 void TrayTracing::OnTracingModeChanged(bool value) { | 104 void TrayTracing::OnTracingModeChanged(bool value) { |
| 107 SetTrayIconVisible(value); | 105 SetTrayIconVisible(value); |
| 108 } | 106 } |
| 109 | 107 |
| 110 } // namespace ash | 108 } // namespace ash |
| OLD | NEW |