| OLD | NEW |
| 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/views/accessible_pane_view.h" | 9 #include "ui/views/accessible_pane_view.h" |
| 10 | 10 |
| 11 struct SkRect; | 11 struct SkRect; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 // Paints the background (including the theme image behind content area) when | 34 // Paints the background (including the theme image behind content area) when |
| 35 // the bar/shelf is attached to the top toolbar. |background_origin| is the | 35 // the bar/shelf is attached to the top toolbar. |background_origin| is the |
| 36 // origin to use for painting the theme image. | 36 // origin to use for painting the theme image. |
| 37 static void PaintBackgroundAttachedMode(gfx::Canvas* canvas, | 37 static void PaintBackgroundAttachedMode(gfx::CanvasSkia* canvas, |
| 38 views::View* view, | 38 views::View* view, |
| 39 const gfx::Point& background_origin); | 39 const gfx::Point& background_origin); |
| 40 | 40 |
| 41 // 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 |
| 42 // 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 |
| 43 // 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, |
| 44 // 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 |
| 45 // 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 |
| 46 // the edges should be. | 46 // the edges should be. |
| 47 static void CalculateContentArea(double animation_state, | 47 static void CalculateContentArea(double animation_state, |
| 48 double horizontal_padding, | 48 double horizontal_padding, |
| 49 double vertical_padding, | 49 double vertical_padding, |
| 50 SkRect* rect, | 50 SkRect* rect, |
| 51 double* roundness, | 51 double* roundness, |
| 52 views::View* view); | 52 views::View* view); |
| 53 | 53 |
| 54 // Paint the horizontal border separating the shelf/bar from the page content. | 54 // Paint the horizontal border separating the shelf/bar from the page content. |
| 55 static void PaintHorizontalBorder(gfx::Canvas* canvas, | 55 static void PaintHorizontalBorder(gfx::CanvasSkia* canvas, |
| 56 DetachableToolbarView* view); | 56 DetachableToolbarView* view); |
| 57 | 57 |
| 58 // Paint the background of the content area (the surface behind the | 58 // Paint the background of the content area (the surface behind the |
| 59 // bookmarks). |rect| is the rectangle to paint the background within. | 59 // bookmarks). |rect| is the rectangle to paint the background within. |
| 60 // |roundness| describes the roundness of the corners. | 60 // |roundness| describes the roundness of the corners. |
| 61 static void PaintContentAreaBackground(gfx::Canvas* canvas, | 61 static void PaintContentAreaBackground(gfx::CanvasSkia* canvas, |
| 62 ui::ThemeProvider* theme_provider, | 62 ui::ThemeProvider* theme_provider, |
| 63 const SkRect& rect, | 63 const SkRect& rect, |
| 64 double roundness); | 64 double roundness); |
| 65 // Paint the border around the content area (when in detached mode). | 65 // Paint the border around the content area (when in detached mode). |
| 66 static void PaintContentAreaBorder(gfx::Canvas* canvas, | 66 static void PaintContentAreaBorder(gfx::CanvasSkia* canvas, |
| 67 ui::ThemeProvider* theme_provider, | 67 ui::ThemeProvider* theme_provider, |
| 68 const SkRect& rect, | 68 const SkRect& rect, |
| 69 double roundness); | 69 double roundness); |
| 70 | 70 |
| 71 // Paint a themed gradient divider at location |x|. |height| is the full | 71 // Paint a themed gradient divider at location |x|. |height| is the full |
| 72 // height of the view you want to paint the divider into, not the height of | 72 // height of the view you want to paint the divider into, not the height of |
| 73 // the divider. The height of the divider will become: | 73 // the divider. The height of the divider will become: |
| 74 // |height| - 2 * |vertical_padding|. | 74 // |height| - 2 * |vertical_padding|. |
| 75 // The color of the divider is a gradient starting with |top_color| at the | 75 // The color of the divider is a gradient starting with |top_color| at the |
| 76 // top, and changing into |middle_color| and then over to |bottom_color| as | 76 // top, and changing into |middle_color| and then over to |bottom_color| as |
| 77 // you go further down. | 77 // you go further down. |
| 78 static void PaintVerticalDivider(gfx::Canvas* canvas, | 78 static void PaintVerticalDivider(gfx::CanvasSkia* canvas, |
| 79 int x, | 79 int x, |
| 80 int height, | 80 int height, |
| 81 int vertical_padding, | 81 int vertical_padding, |
| 82 const SkColor& top_color, | 82 const SkColor& top_color, |
| 83 const SkColor& middle_color, | 83 const SkColor& middle_color, |
| 84 const SkColor& bottom_color); | 84 const SkColor& bottom_color); |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); | 87 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 #endif // CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 90 #endif // CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
| OLD | NEW |