| 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_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
| 10 #include "chrome/browser/ui/views/frame/browser_frame.h" | 10 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 protected: | 90 protected: |
| 91 views::ImageButton* minimize_button() const { return minimize_button_; } | 91 views::ImageButton* minimize_button() const { return minimize_button_; } |
| 92 views::ImageButton* maximize_button() const { return maximize_button_; } | 92 views::ImageButton* maximize_button() const { return maximize_button_; } |
| 93 views::ImageButton* restore_button() const { return restore_button_; } | 93 views::ImageButton* restore_button() const { return restore_button_; } |
| 94 views::ImageButton* close_button() const { return close_button_; } | 94 views::ImageButton* close_button() const { return close_button_; } |
| 95 | 95 |
| 96 // views::View: | 96 // views::View: |
| 97 void OnPaint(gfx::Canvas* canvas) override; | 97 void OnPaint(gfx::Canvas* canvas) override; |
| 98 | 98 |
| 99 // BrowserNonClientFrameView: | 99 // BrowserNonClientFrameView: |
| 100 bool ShouldPaintAsThemed() const override; |
| 100 void UpdateNewStyleAvatar() override; | 101 void UpdateNewStyleAvatar() override; |
| 101 | 102 |
| 102 private: | 103 private: |
| 103 // views::NonClientFrameView: | 104 // views::NonClientFrameView: |
| 104 bool DoesIntersectRect(const views::View* target, | 105 bool DoesIntersectRect(const views::View* target, |
| 105 const gfx::Rect& rect) const override; | 106 const gfx::Rect& rect) const override; |
| 106 | 107 |
| 107 // Creates, adds and returns a new image button with |this| as its listener. | 108 // Creates, adds and returns a new image button with |this| as its listener. |
| 108 // Memory is owned by the caller. | 109 // Memory is owned by the caller. |
| 109 views::ImageButton* InitWindowCaptionButton(int normal_image_id, | 110 views::ImageButton* InitWindowCaptionButton(int normal_image_id, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 137 bool ShouldShowWindowTitleBar() const; | 138 bool ShouldShowWindowTitleBar() const; |
| 138 | 139 |
| 139 // Paint various sub-components of this view. The *FrameBorder() functions | 140 // Paint various sub-components of this view. The *FrameBorder() functions |
| 140 // also paint the background of the titlebar area, since the top frame border | 141 // also paint the background of the titlebar area, since the top frame border |
| 141 // and titlebar background are a contiguous component. | 142 // and titlebar background are a contiguous component. |
| 142 void PaintRestoredFrameBorder(gfx::Canvas* canvas); | 143 void PaintRestoredFrameBorder(gfx::Canvas* canvas); |
| 143 void PaintMaximizedFrameBorder(gfx::Canvas* canvas); | 144 void PaintMaximizedFrameBorder(gfx::Canvas* canvas); |
| 144 void PaintToolbarBackground(gfx::Canvas* canvas); | 145 void PaintToolbarBackground(gfx::Canvas* canvas); |
| 145 void PaintRestoredClientEdge(gfx::Canvas* canvas); | 146 void PaintRestoredClientEdge(gfx::Canvas* canvas); |
| 146 | 147 |
| 147 // Compute aspects of the frame needed to paint the frame background. | |
| 148 SkColor GetFrameColor() const; | |
| 149 gfx::ImageSkia* GetFrameImage() const; | |
| 150 gfx::ImageSkia* GetFrameOverlayImage() const; | |
| 151 int GetTopAreaHeight() const; | |
| 152 | |
| 153 // Returns the bounds of the client area for the specified view size. | 148 // Returns the bounds of the client area for the specified view size. |
| 154 gfx::Rect CalculateClientAreaBounds(int width, int height) const; | 149 gfx::Rect CalculateClientAreaBounds(int width, int height) const; |
| 155 | 150 |
| 156 // Our layout manager also calculates various bounds. | 151 // Our layout manager also calculates various bounds. |
| 157 OpaqueBrowserFrameViewLayout* layout_; | 152 OpaqueBrowserFrameViewLayout* layout_; |
| 158 | 153 |
| 159 // Window controls. | 154 // Window controls. |
| 160 views::ImageButton* minimize_button_; | 155 views::ImageButton* minimize_button_; |
| 161 views::ImageButton* maximize_button_; | 156 views::ImageButton* maximize_button_; |
| 162 views::ImageButton* restore_button_; | 157 views::ImageButton* restore_button_; |
| 163 views::ImageButton* close_button_; | 158 views::ImageButton* close_button_; |
| 164 | 159 |
| 165 // The window icon and title. | 160 // The window icon and title. |
| 166 TabIconView* window_icon_; | 161 TabIconView* window_icon_; |
| 167 views::Label* window_title_; | 162 views::Label* window_title_; |
| 168 | 163 |
| 169 // Background painter for the window frame. | 164 // Background painter for the window frame. |
| 170 scoped_ptr<views::FrameBackground> frame_background_; | 165 scoped_ptr<views::FrameBackground> frame_background_; |
| 171 | 166 |
| 172 // Observer that handles platform dependent configuration. | 167 // Observer that handles platform dependent configuration. |
| 173 scoped_ptr<OpaqueBrowserFrameViewPlatformSpecific> platform_observer_; | 168 scoped_ptr<OpaqueBrowserFrameViewPlatformSpecific> platform_observer_; |
| 174 | 169 |
| 175 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); | 170 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); |
| 176 }; | 171 }; |
| 177 | 172 |
| 178 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 173 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |