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/common/system/tray/tray_empty.h" | 5 #include "ash/common/system/tray/tray_empty.h" |
6 | 6 |
7 #include "ui/views/background.h" | 7 #include "ui/views/background.h" |
8 #include "ui/views/border.h" | 8 #include "ui/views/border.h" |
9 #include "ui/views/layout/box_layout.h" | 9 #include "ui/views/layout/box_layout.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 class EmptyBackground : public views::Background { | 14 class EmptyBackground : public views::Background { |
15 public: | 15 public: |
16 EmptyBackground() {} | 16 EmptyBackground() {} |
17 ~EmptyBackground() override {} | 17 ~EmptyBackground() override {} |
18 | 18 |
19 private: | 19 private: |
20 void Paint(gfx::Canvas* canvas, views::View* view) const override {} | 20 void Paint(gfx::Canvas* canvas, views::View* view) const override {} |
21 | 21 |
22 DISALLOW_COPY_AND_ASSIGN(EmptyBackground); | 22 DISALLOW_COPY_AND_ASSIGN(EmptyBackground); |
23 }; | 23 }; |
24 | |
25 } | 24 } |
26 | 25 |
27 namespace ash { | 26 namespace ash { |
28 | 27 |
29 TrayEmpty::TrayEmpty(SystemTray* system_tray) | 28 TrayEmpty::TrayEmpty(SystemTray* system_tray) : SystemTrayItem(system_tray) {} |
30 : SystemTrayItem(system_tray) { | |
31 } | |
32 | 29 |
33 TrayEmpty::~TrayEmpty() {} | 30 TrayEmpty::~TrayEmpty() {} |
34 | 31 |
35 views::View* TrayEmpty::CreateTrayView(LoginStatus status) { | 32 views::View* TrayEmpty::CreateTrayView(LoginStatus status) { |
36 return NULL; | 33 return NULL; |
37 } | 34 } |
38 | 35 |
39 views::View* TrayEmpty::CreateDefaultView(LoginStatus status) { | 36 views::View* TrayEmpty::CreateDefaultView(LoginStatus status) { |
40 if (status == LoginStatus::NOT_LOGGED_IN) | 37 if (status == LoginStatus::NOT_LOGGED_IN) |
41 return NULL; | 38 return NULL; |
42 | 39 |
43 views::View* view = new views::View; | 40 views::View* view = new views::View; |
44 view->set_background(new EmptyBackground()); | 41 view->set_background(new EmptyBackground()); |
45 view->SetBorder(views::Border::CreateEmptyBorder(10, 0, 0, 0)); | 42 view->SetBorder(views::Border::CreateEmptyBorder(10, 0, 0, 0)); |
46 view->SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, | 43 view->SetLayoutManager( |
47 0, 0, 0)); | 44 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); |
48 view->SetPaintToLayer(true); | 45 view->SetPaintToLayer(true); |
49 view->layer()->SetFillsBoundsOpaquely(false); | 46 view->layer()->SetFillsBoundsOpaquely(false); |
50 return view; | 47 return view; |
51 } | 48 } |
52 | 49 |
53 views::View* TrayEmpty::CreateDetailedView(LoginStatus status) { | 50 views::View* TrayEmpty::CreateDetailedView(LoginStatus status) { |
54 return NULL; | 51 return NULL; |
55 } | 52 } |
56 | 53 |
57 void TrayEmpty::DestroyTrayView() {} | 54 void TrayEmpty::DestroyTrayView() {} |
58 | 55 |
59 void TrayEmpty::DestroyDefaultView() {} | 56 void TrayEmpty::DestroyDefaultView() {} |
60 | 57 |
61 void TrayEmpty::DestroyDetailedView() {} | 58 void TrayEmpty::DestroyDetailedView() {} |
62 | 59 |
63 void TrayEmpty::UpdateAfterLoginStatusChange(LoginStatus status) {} | 60 void TrayEmpty::UpdateAfterLoginStatusChange(LoginStatus status) {} |
64 | 61 |
65 } // namespace ash | 62 } // namespace ash |
OLD | NEW |