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 CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
7 | 7 |
8 #include "ui/views/accessible_pane_view.h" | 8 #include "ui/views/accessible_pane_view.h" |
9 | 9 |
10 struct SkRect; | 10 struct SkRect; |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Whether the view is currently detached from the Chrome frame. | 24 // Whether the view is currently detached from the Chrome frame. |
25 virtual bool IsDetached() const = 0; | 25 virtual bool IsDetached() const = 0; |
26 | 26 |
27 // Gets the current state of the resize animation (show/hide). | 27 // Gets the current state of the resize animation (show/hide). |
28 virtual double GetAnimationValue() const = 0; | 28 virtual double GetAnimationValue() const = 0; |
29 | 29 |
30 // Gets the current amount of overlap atop the browser toolbar. | 30 // Gets the current amount of overlap atop the browser toolbar. |
31 virtual int GetToolbarOverlap() const = 0; | 31 virtual int GetToolbarOverlap() const = 0; |
32 | 32 |
33 // Gets the Left/Right margins to use, if any. | |
34 virtual int GetLeftMargin() const = 0; | |
35 virtual int GetRightMargin() const = 0; | |
36 | |
37 // Paints the background (including the theme image behind content area) when | 33 // Paints the background (including the theme image behind content area) when |
38 // the bar/shelf is attached to the top toolbar. |background_origin| is the | 34 // the bar/shelf is attached to the top toolbar. |background_origin| is the |
39 // origin to use for painting the theme image. | 35 // origin to use for painting the theme image. |
40 static void PaintBackgroundAttachedMode(gfx::Canvas* canvas, | 36 static void PaintBackgroundAttachedMode(gfx::Canvas* canvas, |
41 views::View* view, | 37 views::View* view, |
42 const gfx::Point& background_origin); | 38 const gfx::Point& background_origin); |
43 | 39 |
44 // Calculate the rect for the content area of the bar/shelf. This is only | 40 // Calculate the rect for the content area of the bar/shelf. This is only |
45 // needed when the bar/shelf is detached from the Chrome frame (otherwise the | 41 // needed when the bar/shelf is detached from the Chrome frame (otherwise the |
46 // content area is the whole area of the bar/shelf. When detached, however, | 42 // content area is the whole area of the bar/shelf. When detached, however, |
47 // only a small round rectangle is for drawing our content on. This calculates | 43 // only a small round rectangle is for drawing our content on. This calculates |
48 // how big this area is, where it is located within the shelf and how round | 44 // how big this area is, where it is located within the shelf and how round |
49 // the edges should be. | 45 // the edges should be. |
50 static void CalculateContentArea(double animation_state, | 46 static void CalculateContentArea(double animation_state, |
51 double horizontal_padding, | 47 double horizontal_padding, |
52 double vertical_padding, | 48 double vertical_padding, |
53 SkRect* rect, | 49 SkRect* rect, |
54 double* roundness, | 50 double* roundness, |
55 views::View* view); | 51 views::View* view); |
56 | 52 |
57 // Paint the horizontal border separating the shelf/bar from the page content, | 53 // Paint the horizontal border separating the shelf/bar from the page content. |
58 // with COLOR_TOOLBAR_SEPARATOR. | |
59 static void PaintHorizontalBorder(gfx::Canvas* canvas, | 54 static void PaintHorizontalBorder(gfx::Canvas* canvas, |
60 DetachableToolbarView* view); | 55 DetachableToolbarView* view); |
61 | 56 |
62 // Similar to PaintHorizontalBorder but with the specified |border_color|. | |
63 static void PaintHorizontalBorderWithColor(gfx::Canvas* canvas, | |
64 DetachableToolbarView* view, | |
65 SkColor border_color); | |
66 | |
67 // Paint the background of the content area (the surface behind the | 57 // Paint the background of the content area (the surface behind the |
68 // bookmarks). |rect| is the rectangle to paint the background within. | 58 // bookmarks). |rect| is the rectangle to paint the background within. |
69 // |roundness| describes the roundness of the corners. | 59 // |roundness| describes the roundness of the corners. |
70 static void PaintContentAreaBackground(gfx::Canvas* canvas, | 60 static void PaintContentAreaBackground(gfx::Canvas* canvas, |
71 ui::ThemeProvider* theme_provider, | 61 ui::ThemeProvider* theme_provider, |
72 const SkRect& rect, | 62 const SkRect& rect, |
73 double roundness); | 63 double roundness); |
74 // Paint the border around the content area (when in detached mode). | 64 // Paint the border around the content area (when in detached mode). |
75 static void PaintContentAreaBorder(gfx::Canvas* canvas, | 65 static void PaintContentAreaBorder(gfx::Canvas* canvas, |
76 ui::ThemeProvider* theme_provider, | 66 ui::ThemeProvider* theme_provider, |
(...skipping 13 matching lines...) Expand all Loading... |
90 int vertical_padding, | 80 int vertical_padding, |
91 SkColor top_color, | 81 SkColor top_color, |
92 SkColor middle_color, | 82 SkColor middle_color, |
93 SkColor bottom_color); | 83 SkColor bottom_color); |
94 | 84 |
95 private: | 85 private: |
96 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); | 86 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); |
97 }; | 87 }; |
98 | 88 |
99 #endif // CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 89 #endif // CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
OLD | NEW |