OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef ASH_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ | |
6 #define ASH_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "ui/views/bubble/bubble_border.h" | |
11 | |
12 namespace ash { | |
13 | |
14 // A class to paint bubble border and background. | |
15 class AppListBubbleBorder : public views::BubbleBorder { | |
16 public: | |
17 explicit AppListBubbleBorder(views::View* app_list_view); | |
18 virtual ~AppListBubbleBorder(); | |
19 | |
20 int arrow_offset() const { | |
21 return arrow_offset_; | |
22 } | |
23 void set_arrow_offset(int arrow_offset) { | |
24 arrow_offset_ = arrow_offset; | |
25 } | |
26 | |
27 private: | |
28 void PaintModelViewBackground(gfx::Canvas* canvas, | |
29 const gfx::Rect& bounds) const; | |
30 void PaintPageSwitcherBackground(gfx::Canvas* canvas, | |
31 const gfx::Rect& bounds) const; | |
32 | |
33 // views::BubbleBorder overrides: | |
34 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; | |
35 virtual gfx::Rect GetBounds(const gfx::Rect& position_relative_to, | |
36 const gfx::Size& contents_size) const OVERRIDE; | |
37 | |
38 // views::Border overrides: | |
39 virtual void Paint(const views::View& view, | |
40 gfx::Canvas* canvas) const OVERRIDE; | |
41 | |
42 // AppListView hosted inside this bubble. | |
43 views::View* app_list_view_; | |
44 | |
45 // Offset in pixels relative the default middle position. | |
46 int arrow_offset_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(AppListBubbleBorder); | |
49 }; | |
50 | |
51 } // namespace ash | |
52 | |
53 #endif // ASH_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ | |
OLD | NEW |