| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void set_background_color(SkColor color) { background_color_ = color; } | 96 void set_background_color(SkColor color) { background_color_ = color; } |
| 97 SkColor background_color() const { return background_color_; } | 97 SkColor background_color() const { return background_color_; } |
| 98 | 98 |
| 99 void set_client_bounds(const gfx::Rect& bounds) { client_bounds_ = bounds; } | 99 void set_client_bounds(const gfx::Rect& bounds) { client_bounds_ = bounds; } |
| 100 const gfx::Rect& client_bounds() const { return client_bounds_; } | 100 const gfx::Rect& client_bounds() const { return client_bounds_; } |
| 101 | 101 |
| 102 // For borders with an arrow, gives the desired bounds (in screen coordinates) | 102 // For borders with an arrow, gives the desired bounds (in screen coordinates) |
| 103 // given the rect to point to and the size of the contained contents. This | 103 // given the rect to point to and the size of the contained contents. This |
| 104 // depends on the arrow location, so if you change that, you should call this | 104 // depends on the arrow location, so if you change that, you should call this |
| 105 // again to find out the new coordinates. | 105 // again to find out the new coordinates. |
| 106 gfx::Rect GetBounds(const gfx::Rect& position_relative_to, | 106 virtual gfx::Rect GetBounds(const gfx::Rect& position_relative_to, |
| 107 const gfx::Size& contents_size) const; | 107 const gfx::Size& contents_size) const; |
| 108 | 108 |
| 109 // Sets a fixed offset for the arrow from the beginning of corresponding edge. | 109 // Sets a fixed offset for the arrow from the beginning of corresponding edge. |
| 110 // The arrow will still point to the same location but the bubble will shift | 110 // The arrow will still point to the same location but the bubble will shift |
| 111 // location to make that happen. Returns actuall arrow offset, in case of | 111 // location to make that happen. Returns actuall arrow offset, in case of |
| 112 // overflow it differ from desired. | 112 // overflow it differ from desired. |
| 113 int SetArrowOffset(int offset, const gfx::Size& contents_size); | 113 int SetArrowOffset(int offset, const gfx::Size& contents_size); |
| 114 | 114 |
| 115 // Overridden from views::Border: | 115 // Overridden from views::Border: |
| 116 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; | 116 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; |
| 117 | 117 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 private: | 184 private: |
| 185 BubbleBorder* border_; | 185 BubbleBorder* border_; |
| 186 | 186 |
| 187 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); | 187 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 } // namespace views | 190 } // namespace views |
| 191 | 191 |
| 192 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 192 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
| OLD | NEW |