[Eraser strings] Remove unused Supervised User infobar and corresponding strings
[chromium-blink-merge.git] / chrome / browser / android / compositor / layer / throbber_layer.h
blob99cdea6f16d516f935edd55e9e93e0c6d1b040d5
1 // Copyright 2015 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.
5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_THROBBER_LAYER_H_
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_THROBBER_LAYER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/time/time.h"
12 #include "cc/layers/content_layer_client.h"
13 #include "chrome/browser/android/compositor/layer/layer.h"
14 #include "third_party/skia/include/core/SkColor.h"
15 #include "third_party/skia/include/core/SkPictureRecorder.h"
17 namespace cc {
18 class DisplayItemList;
19 class Layer;
20 class PictureLayer;
23 namespace gfx {
24 class Rect;
27 namespace chrome {
28 namespace android {
30 // A layer representing throbber which we use as a reloading spinner on the
31 // tab strip for tablets.
32 // TODO(changwan): implement WAITING state for which we should spin
33 // counterclockwise until connection to the server is made.
34 class ThrobberLayer : public Layer, cc::ContentLayerClient {
35 public:
36 static scoped_refptr<ThrobberLayer> Create(SkColor color);
38 void Show(const base::Time& time);
39 void Hide();
40 void SetColor(SkColor color);
41 void UpdateThrobber(const base::Time& time);
43 // Layer:
44 scoped_refptr<cc::Layer> layer() override;
46 // cc::ContentLayerClient:
47 void PaintContents(
48 SkCanvas* canvas,
49 const gfx::Rect& clip,
50 ContentLayerClient::PaintingControlSetting painting_control) override;
51 scoped_refptr<cc::DisplayItemList> PaintContentsToDisplayList(
52 const gfx::Rect& clip,
53 ContentLayerClient::PaintingControlSetting painting_control) override;
54 bool FillsBoundsCompletely() const override;
55 size_t GetApproximateUnsharedMemoryUsage() const override;
57 protected:
58 explicit ThrobberLayer(unsigned int color);
59 ~ThrobberLayer() override;
61 private:
62 SkColor color_;
63 base::Time start_time_;
64 base::Time update_time_;
65 scoped_refptr<cc::PictureLayer> layer_;
67 DISALLOW_COPY_AND_ASSIGN(ThrobberLayer);
70 } // namespace android
71 } // namespace chrome
73 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_THROBBER_LAYER_H_