[Media Router] Add integration tests and e2e tests for media router and presentation...
[chromium-blink-merge.git] / chrome / common / icon_with_badge_image_source.h
blobf120a0a770d67c625b00b588de925a3986172460
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.
5 #ifndef CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_
6 #define CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_
8 #include <string>
10 #include "chrome/common/extensions/api/extension_action/action_info.h"
11 #include "ui/gfx/image/canvas_image_source.h"
12 #include "ui/gfx/image/image_skia.h"
14 namespace gfx {
15 class Size;
18 // CanvasImageSource for creating extension icon with a badge.
19 class IconWithBadgeImageSource
20 : public gfx::CanvasImageSource {
21 public:
22 IconWithBadgeImageSource(
23 const gfx::ImageSkia& icon,
24 const gfx::Size& icon_size,
25 const gfx::Size& spacing,
26 const std::string& text,
27 const SkColor& text_color,
28 const SkColor& background_color,
29 extensions::ActionInfo::Type action_type);
30 ~IconWithBadgeImageSource() override;
32 private:
33 void Draw(gfx::Canvas* canvas) override;
35 // Browser action icon image.
36 gfx::ImageSkia icon_;
38 // Extra spacing for badge compared to icon bounds.
39 gfx::Size spacing_;
41 // Text to be displayed on the badge.
42 std::string text_;
44 // Color of badge text.
45 SkColor text_color_;
47 // Color of the badge.
48 SkColor background_color_;
50 // Type of extension action this is for.
51 extensions::ActionInfo::Type action_type_;
53 DISALLOW_COPY_AND_ASSIGN(IconWithBadgeImageSource);
56 #endif // CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_