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_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ | 5 #ifndef UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ |
6 #define UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ | 6 #define UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/gfx/shadow_value.h" | 10 #include "ui/gfx/shadow_value.h" |
11 #include "ui/views/bubble/bubble_border.h" | 11 #include "ui/views/bubble/bubble_border.h" |
12 | 12 |
13 namespace app_list { | 13 namespace app_list { |
14 | 14 |
15 // A class to paint bubble border and background. | 15 // A class to paint bubble border and background. |
16 class AppListBubbleBorder : public views::BubbleBorder { | 16 class AppListBubbleBorder : public views::BubbleBorder { |
17 public: | 17 public: |
18 AppListBubbleBorder(views::View* app_list_view, | 18 AppListBubbleBorder(views::View* app_list_view, |
19 views::View* search_box_view); | 19 views::View* search_box_view); |
20 virtual ~AppListBubbleBorder(); | 20 virtual ~AppListBubbleBorder(); |
21 | 21 |
22 bool ArrowAtTopOrBottom() const; | 22 bool ArrowAtTopOrBottom() const; |
23 bool ArrowOnLeftOrRight() const; | 23 bool ArrowOnLeftOrRight() const; |
24 | 24 |
| 25 void GetMask(const gfx::Rect& bounds, gfx::Path* mask) const; |
| 26 |
25 void set_offset(const gfx::Point& offset) { offset_ = offset; } | 27 void set_offset(const gfx::Point& offset) { offset_ = offset; } |
26 const gfx::Point& offset() const { return offset_; } | 28 const gfx::Point& offset() const { return offset_; } |
27 | 29 |
28 private: | 30 private: |
29 // Gets arrow offset based on arrow location and |offset_|. | 31 // Gets arrow offset based on arrow location and |offset_|. |
30 int GetArrowOffset() const; | 32 int GetArrowOffset() const; |
31 | 33 |
32 void PaintBackground(gfx::Canvas* canvas, | 34 void PaintBackground(gfx::Canvas* canvas, |
33 const gfx::Rect& bounds) const; | 35 const gfx::Rect& bounds) const; |
34 | 36 |
(...skipping 16 matching lines...) Expand all Loading... |
51 gfx::Point offset_; | 53 gfx::Point offset_; |
52 | 54 |
53 gfx::ShadowValues shadows_; | 55 gfx::ShadowValues shadows_; |
54 | 56 |
55 DISALLOW_COPY_AND_ASSIGN(AppListBubbleBorder); | 57 DISALLOW_COPY_AND_ASSIGN(AppListBubbleBorder); |
56 }; | 58 }; |
57 | 59 |
58 } // namespace app_list | 60 } // namespace app_list |
59 | 61 |
60 #endif // UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ | 62 #endif // UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ |
OLD | NEW |