15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ash/system/tray/tray_empty.h"
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/views/layout/box_layout.h"
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/views/background.h"
9a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "ui/views/border.h"
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/views/view.h"
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace {
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class EmptyBackground : public views::Background {
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  EmptyBackground() {}
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~EmptyBackground() {}
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  }
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(EmptyBackground);
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ash {
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)TrayEmpty::TrayEmpty(SystemTray* system_tray)
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    : SystemTrayItem(system_tray) {
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)TrayEmpty::~TrayEmpty() {}
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)views::View* TrayEmpty::CreateTrayView(user::LoginStatus status) {
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  return NULL;
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)views::View* TrayEmpty::CreateDefaultView(user::LoginStatus status) {
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  if (status == user::LOGGED_IN_NONE)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    return NULL;
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  views::View* view = new views::View;
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  view->set_background(new EmptyBackground());
465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  view->SetBorder(views::Border::CreateEmptyBorder(10, 0, 0, 0));
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  view->SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        0, 0, 0));
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  view->SetPaintToLayer(true);
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  view->SetFillsBoundsOpaquely(false);
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  return view;
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)views::View* TrayEmpty::CreateDetailedView(user::LoginStatus status) {
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  return NULL;
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void TrayEmpty::DestroyTrayView() {}
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void TrayEmpty::DestroyDefaultView() {}
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void TrayEmpty::DestroyDetailedView() {}
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void TrayEmpty::UpdateAfterLoginStatusChange(user::LoginStatus status) {}
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace ash
67