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