| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
| 6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 private: | 121 private: |
| 122 struct BorderImages; | 122 struct BorderImages; |
| 123 | 123 |
| 124 // Loads images if necessary. | 124 // Loads images if necessary. |
| 125 static BorderImages* GetBorderImages(Shadow shadow); | 125 static BorderImages* GetBorderImages(Shadow shadow); |
| 126 | 126 |
| 127 virtual ~BubbleBorder(); | 127 virtual ~BubbleBorder(); |
| 128 | 128 |
| 129 // Overridden from views::Border: | 129 // Overridden from views::Border: |
| 130 virtual void Paint(const views::View& view, | 130 virtual void Paint(const views::View& view, |
| 131 gfx::Canvas* canvas) const OVERRIDE; | 131 gfx::CanvasSkia* canvas) const OVERRIDE; |
| 132 | 132 |
| 133 void DrawEdgeWithArrow(gfx::Canvas* canvas, | 133 void DrawEdgeWithArrow(gfx::CanvasSkia* canvas, |
| 134 bool is_horizontal, | 134 bool is_horizontal, |
| 135 SkBitmap* edge, | 135 SkBitmap* edge, |
| 136 SkBitmap* arrow, | 136 SkBitmap* arrow, |
| 137 int start_x, | 137 int start_x, |
| 138 int start_y, | 138 int start_y, |
| 139 int before_arrow, | 139 int before_arrow, |
| 140 int after_arrow, | 140 int after_arrow, |
| 141 int offset) const; | 141 int offset) const; |
| 142 | 142 |
| 143 void DrawArrowInterior(gfx::Canvas* canvas, | 143 void DrawArrowInterior(gfx::CanvasSkia* canvas, |
| 144 bool is_horizontal, | 144 bool is_horizontal, |
| 145 int tip_x, | 145 int tip_x, |
| 146 int tip_y, | 146 int tip_y, |
| 147 int shift_x, | 147 int shift_x, |
| 148 int shift_y) const; | 148 int shift_y) const; |
| 149 | 149 |
| 150 // Border graphics. | 150 // Border graphics. |
| 151 struct BorderImages* images_; | 151 struct BorderImages* images_; |
| 152 | 152 |
| 153 // Image bundles. | 153 // Image bundles. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 171 DISALLOW_COPY_AND_ASSIGN(BubbleBorder); | 171 DISALLOW_COPY_AND_ASSIGN(BubbleBorder); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 // A Background that clips itself to the specified BubbleBorder and uses | 174 // A Background that clips itself to the specified BubbleBorder and uses |
| 175 // the background color of the BubbleBorder. | 175 // the background color of the BubbleBorder. |
| 176 class VIEWS_EXPORT BubbleBackground : public views::Background { | 176 class VIEWS_EXPORT BubbleBackground : public views::Background { |
| 177 public: | 177 public: |
| 178 explicit BubbleBackground(BubbleBorder* border) : border_(border) {} | 178 explicit BubbleBackground(BubbleBorder* border) : border_(border) {} |
| 179 | 179 |
| 180 // Background overrides. | 180 // Background overrides. |
| 181 virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE; | 181 virtual void Paint(gfx::CanvasSkia* canvas, views::View* view) const OVERRIDE; |
| 182 | 182 |
| 183 private: | 183 private: |
| 184 BubbleBorder* border_; | 184 BubbleBorder* border_; |
| 185 | 185 |
| 186 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); | 186 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace views | 189 } // namespace views |
| 190 | 190 |
| 191 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 191 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
| OLD | NEW |