summaryrefslogtreecommitdiffstats
path: root/ui/app_list/views/pulsing_block_view.h
blob: 160ee0ccb36eb82ea29febd6a0e47141d480b4ec (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
// 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.

#ifndef UI_APP_LIST_VIEWS_PULSING_BLOCK_VIEW_H_
#define UI_APP_LIST_VIEWS_PULSING_BLOCK_VIEW_H_

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/timer/timer.h"
#include "ui/views/view.h"

namespace gfx {
class Size;
}

namespace app_list {

// PulsingBlockView shows a pulsing white block via layer animation.
class PulsingBlockView : public views::View {
 public:
  // Constructs a PulsingBlockView of |size|. If |start_delay| is true,
  // starts the pulsing animation after a random delay.
  PulsingBlockView(const gfx::Size& size, bool start_delay);
  ~PulsingBlockView() override;

 private:
  void OnStartDelayTimer();

  // views::View overrides:
  void OnPaint(gfx::Canvas* canvas) override;

  base::OneShotTimer<PulsingBlockView> start_delay_timer_;

  DISALLOW_COPY_AND_ASSIGN(PulsingBlockView);
};

}  // namespace app_list

#endif  // UI_APP_LIST_VIEWS_PULSING_BLOCK_VIEW_H_