OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
6 #define CHROME_BROWSER_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
7 | 7 |
8 #include "chrome/browser/views/accessible_toolbar_view.h" | 8 #include "chrome/browser/views/accessible_toolbar_view.h" |
9 | 9 |
10 class SkBitmap; | 10 class SkBitmap; |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Whether the view is currently detached from the Chrome frame. | 25 // Whether the view is currently detached from the Chrome frame. |
26 virtual bool IsDetached() const = 0; | 26 virtual bool IsDetached() const = 0; |
27 | 27 |
28 // Gets the current state of the resize animation (show/hide). | 28 // Gets the current state of the resize animation (show/hide). |
29 virtual double GetAnimationValue() const = 0; | 29 virtual double GetAnimationValue() const = 0; |
30 | 30 |
31 // Gets the current amount of overlap atop the browser toolbar. | 31 // Gets the current amount of overlap atop the browser toolbar. |
32 virtual int GetToolbarOverlap() const = 0; | 32 virtual int GetToolbarOverlap() const = 0; |
33 | 33 |
34 // Paint the background (including the theme image behind content area) when | 34 // Paints the background (including the theme image behind content area) when |
35 // in bar/shelf is attached to the Chrome frame. | 35 // the bar/shelf is attached to the top toolbar. |background_origin| is the |
| 36 // origin to use for painting the theme image. |
36 static void PaintBackgroundAttachedMode(gfx::Canvas* canvas, | 37 static void PaintBackgroundAttachedMode(gfx::Canvas* canvas, |
37 views::View* view); | 38 views::View* view, |
| 39 const gfx::Point& background_origin); |
38 | 40 |
39 // Calculate the rect for the content area of the bar/shelf. This is only | 41 // Calculate the rect for the content area of the bar/shelf. This is only |
40 // needed when the bar/shelf is detached from the Chrome frame (otherwise the | 42 // needed when the bar/shelf is detached from the Chrome frame (otherwise the |
41 // content area is the whole area of the bar/shelf. When detached, however, | 43 // content area is the whole area of the bar/shelf. When detached, however, |
42 // only a small round rectangle is for drawing our content on. This calculates | 44 // only a small round rectangle is for drawing our content on. This calculates |
43 // how big this area is, where it is located within the shelf and how round | 45 // how big this area is, where it is located within the shelf and how round |
44 // the edges should be. | 46 // the edges should be. |
45 static void CalculateContentArea(double animation_state, | 47 static void CalculateContentArea(double animation_state, |
46 double horizontal_padding, | 48 double horizontal_padding, |
47 double vertical_padding, | 49 double vertical_padding, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 int vertical_padding, | 81 int vertical_padding, |
80 const SkColor& top_color, | 82 const SkColor& top_color, |
81 const SkColor& middle_color, | 83 const SkColor& middle_color, |
82 const SkColor& bottom_color); | 84 const SkColor& bottom_color); |
83 | 85 |
84 private: | 86 private: |
85 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); | 87 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); |
86 }; | 88 }; |
87 | 89 |
88 #endif // CHROME_BROWSER_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 90 #endif // CHROME_BROWSER_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
OLD | NEW |