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 "chrome/browser/ui/host_desktop.h" | 8 #include "chrome/browser/ui/host_desktop.h" |
9 #include "ui/views/accessible_pane_view.h" | 9 #include "ui/views/accessible_pane_view.h" |
10 | 10 |
11 struct SkRect; | |
12 | |
13 // DetachableToolbarView contains functionality common to views that can detach | 11 // DetachableToolbarView contains functionality common to views that can detach |
14 // from the Chrome frame, such as the BookmarkBarView and the Extension shelf. | 12 // from the Chrome frame, such as the BookmarkBarView and the Extension shelf. |
15 class DetachableToolbarView : public views::AccessiblePaneView { | 13 class DetachableToolbarView : public views::AccessiblePaneView { |
16 public: | 14 public: |
17 DetachableToolbarView() {} | 15 DetachableToolbarView() {} |
18 ~DetachableToolbarView() override {} | 16 ~DetachableToolbarView() override {} |
19 | 17 |
20 // Whether the view is currently detached from the Chrome frame. | 18 // Whether the view is currently detached from the Chrome frame. |
21 virtual bool IsDetached() const = 0; | 19 virtual bool IsDetached() const = 0; |
22 | 20 |
(...skipping 13 matching lines...) Expand all Loading... |
36 const gfx::Point& background_origin, | 34 const gfx::Point& background_origin, |
37 chrome::HostDesktopType host_desktop_type); | 35 chrome::HostDesktopType host_desktop_type); |
38 | 36 |
39 // Paint the horizontal border separating the shelf/bar from the toolbar or | 37 // Paint the horizontal border separating the shelf/bar from the toolbar or |
40 // page content according to |at_top| with |color|. | 38 // page content according to |at_top| with |color|. |
41 static void PaintHorizontalBorder(gfx::Canvas* canvas, | 39 static void PaintHorizontalBorder(gfx::Canvas* canvas, |
42 DetachableToolbarView* view, | 40 DetachableToolbarView* view, |
43 bool at_top, | 41 bool at_top, |
44 SkColor color); | 42 SkColor color); |
45 | 43 |
46 // Paint a themed gradient divider at location |x|. |height| is the full | |
47 // height of the view you want to paint the divider into, not the height of | |
48 // the divider. The height of the divider will become: | |
49 // |height| - 2 * |vertical_padding|. | |
50 // The color of the divider is a gradient starting with |top_color| at the | |
51 // top, and changing into |middle_color| and then over to |bottom_color| as | |
52 // you go further down. | |
53 static void PaintVerticalDivider(gfx::Canvas* canvas, | |
54 int x, | |
55 int height, | |
56 int vertical_padding, | |
57 SkColor top_color, | |
58 SkColor middle_color, | |
59 SkColor bottom_color); | |
60 | |
61 private: | 44 private: |
62 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); | 45 DISALLOW_COPY_AND_ASSIGN(DetachableToolbarView); |
63 }; | 46 }; |
64 | 47 |
65 #endif // CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ | 48 #endif // CHROME_BROWSER_UI_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ |
OLD | NEW |