Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h

Issue 189463013: [Refactor] Move code for painting the window header for browser windows out of ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" 10 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 virtual void UpdateWindowIcon() OVERRIDE; 50 virtual void UpdateWindowIcon() OVERRIDE;
51 virtual void UpdateWindowTitle() OVERRIDE; 51 virtual void UpdateWindowTitle() OVERRIDE;
52 52
53 // views::View overrides: 53 // views::View overrides:
54 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 54 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
55 virtual void Layout() OVERRIDE; 55 virtual void Layout() OVERRIDE;
56 virtual const char* GetClassName() const OVERRIDE; 56 virtual const char* GetClassName() const OVERRIDE;
57 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; 57 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
58 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; 58 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
59 virtual gfx::Size GetMinimumSize() OVERRIDE; 59 virtual gfx::Size GetMinimumSize() OVERRIDE;
60 virtual void OnThemeChanged() OVERRIDE;
61 60
62 // Overridden from chrome::TabIconViewModel: 61 // Overridden from chrome::TabIconViewModel:
63 virtual bool ShouldTabIconViewAnimate() const OVERRIDE; 62 virtual bool ShouldTabIconViewAnimate() const OVERRIDE;
64 virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; 63 virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE;
65 64
66 private: 65 private:
67 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); 66 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader);
68 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, 67 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest,
69 NonImmersiveFullscreen); 68 NonImmersiveFullscreen);
70 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, 69 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest,
(...skipping 22 matching lines...) Expand all
93 // Returns true if there is anything to paint. Some fullscreen windows do not 92 // Returns true if there is anything to paint. Some fullscreen windows do not
94 // need their frames painted. 93 // need their frames painted.
95 bool ShouldPaint() const; 94 bool ShouldPaint() const;
96 95
97 // Paints the header background when the frame is in immersive fullscreen and 96 // Paints the header background when the frame is in immersive fullscreen and
98 // tab light bar is visible. 97 // tab light bar is visible.
99 void PaintImmersiveLightbarStyleHeader(gfx::Canvas* canvas); 98 void PaintImmersiveLightbarStyleHeader(gfx::Canvas* canvas);
100 99
101 void PaintToolbarBackground(gfx::Canvas* canvas); 100 void PaintToolbarBackground(gfx::Canvas* canvas);
102 101
103 // Windows without a toolbar need to draw their own line under the header, 102 // Draws the line under the header for windows without a toolbar and not using
104 // above the content area. 103 // the packaged app header style.
105 void PaintContentEdge(gfx::Canvas* canvas); 104 void PaintContentEdge(gfx::Canvas* canvas);
106 105
107 // Sets |frame_image_id| and |frame_image_overlay_id| to the ids of the header
108 // frame image and the header frame overlay image respectively which should be
109 // used for tabbed browser windows. |frame_overlay_image_id| is set to 0 if no
110 // overlay image should be used.
111 void GetFrameImageIdsForTabbedBrowser(int* frame_image_id,
112 int* frame_overlay_image_id) const;
113
114
115 // Returns the id of the header frame image which should be used for browser
116 // popups. Browser popups are not themed and do not use a frame overlay image.
117 int GetFrameImageIdForBrowserPopup() const;
118
119 // Returns the id of the header frame image which should be used for hosted
120 // apps. Hosted apps are not themed and do not use a frame overlay image.
121 int GetFrameImageIdForHostedApp() const;
122
123 // View which contains the window controls. 106 // View which contains the window controls.
124 ash::FrameCaptionButtonContainerView* caption_button_container_; 107 ash::FrameCaptionButtonContainerView* caption_button_container_;
125 108
126 // For popups, the window icon. 109 // For popups, the window icon.
127 TabIconView* window_icon_; 110 TabIconView* window_icon_;
128 111
129 // Helper class for painting the header. 112 // Helper class for painting the header.
130 scoped_ptr<ash::HeaderPainter> header_painter_; 113 scoped_ptr<ash::HeaderPainter> header_painter_;
131 114
132 // Updates the hittest bounds overrides based on the window show type. 115 // Updates the hittest bounds overrides based on the window show type.
133 scoped_ptr<ash::FrameBorderHitTestController> 116 scoped_ptr<ash::FrameBorderHitTestController>
134 frame_border_hit_test_controller_; 117 frame_border_hit_test_controller_;
135 118
136 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); 119 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh);
137 }; 120 };
138 121
139 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ 122 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698