summaryrefslogtreecommitdiffstats
path: root/ash/system/tray/tray_empty.cc
blob: 821632233af35a6562ddaa3aabad9b63d40bb2da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/system/tray/tray_empty.h"

#include "ui/views/layout/box_layout.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/view.h"

namespace {

class EmptyBackground : public views::Background {
 public:
  EmptyBackground() {}
  ~EmptyBackground() override {}

 private:
  void Paint(gfx::Canvas* canvas, views::View* view) const override {}

  DISALLOW_COPY_AND_ASSIGN(EmptyBackground);
};

}

namespace ash {

TrayEmpty::TrayEmpty(SystemTray* system_tray)
    : SystemTrayItem(system_tray) {
}

TrayEmpty::~TrayEmpty() {}

views::View* TrayEmpty::CreateTrayView(user::LoginStatus status) {
  return NULL;
}

views::View* TrayEmpty::CreateDefaultView(user::LoginStatus status) {
  if (status == user::LOGGED_IN_NONE)
    return NULL;

  views::View* view = new views::View;
  view->set_background(new EmptyBackground());
  view->SetBorder(views::Border::CreateEmptyBorder(10, 0, 0, 0));
  view->SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
        0, 0, 0));
  view->SetPaintToLayer(true);
  view->SetFillsBoundsOpaquely(false);
  return view;
}

views::View* TrayEmpty::CreateDetailedView(user::LoginStatus status) {
  return NULL;
}

void TrayEmpty::DestroyTrayView() {}

void TrayEmpty::DestroyDefaultView() {}

void TrayEmpty::DestroyDetailedView() {}

void TrayEmpty::UpdateAfterLoginStatusChange(user::LoginStatus status) {}

}  // namespace ash