| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/views/frame/browser_frame.h" | 10 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 virtual void Layout() OVERRIDE; | 67 virtual void Layout() OVERRIDE; |
| 68 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | 68 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; |
| 69 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 69 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 70 | 70 |
| 71 // Overridden from views::ButtonListener: | 71 // Overridden from views::ButtonListener: |
| 72 virtual void ButtonPressed(views::Button* sender, const views::Event& event) | 72 virtual void ButtonPressed(views::Button* sender, const views::Event& event) |
| 73 OVERRIDE; | 73 OVERRIDE; |
| 74 | 74 |
| 75 // Overridden from TabIconView::TabIconViewModel: | 75 // Overridden from TabIconView::TabIconViewModel: |
| 76 virtual bool ShouldTabIconViewAnimate() const OVERRIDE; | 76 virtual bool ShouldTabIconViewAnimate() const OVERRIDE; |
| 77 virtual SkBitmap GetFaviconForTabIconView() OVERRIDE; | 77 virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; |
| 78 | 78 |
| 79 // content::NotificationObserver implementation: | 79 // content::NotificationObserver implementation: |
| 80 virtual void Observe(int type, | 80 virtual void Observe(int type, |
| 81 const content::NotificationSource& source, | 81 const content::NotificationSource& source, |
| 82 const content::NotificationDetails& details) OVERRIDE; | 82 const content::NotificationDetails& details) OVERRIDE; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 // Creates, adds and returns a new image button with |this| as its listener. | 85 // Creates, adds and returns a new image button with |this| as its listener. |
| 86 // Memory is owned by the caller. | 86 // Memory is owned by the caller. |
| 87 views::ImageButton* InitWindowCaptionButton(int normal_bitmap_id, | 87 views::ImageButton* InitWindowCaptionButton(int normal_image_id, |
| 88 int hot_bitmap_id, | 88 int hot_image_id, |
| 89 int pushed_bitmap_id, | 89 int pushed_image_id, |
| 90 int mask_bitmap_id, | 90 int mask_image_id, |
| 91 int accessibility_string_id); | 91 int accessibility_string_id); |
| 92 | 92 |
| 93 // Returns the thickness of the border that makes up the window frame edges. | 93 // Returns the thickness of the border that makes up the window frame edges. |
| 94 // This does not include any client edge. If |restored| is true, acts as if | 94 // This does not include any client edge. If |restored| is true, acts as if |
| 95 // the window is restored regardless of the real mode. | 95 // the window is restored regardless of the real mode. |
| 96 int FrameBorderThickness(bool restored) const; | 96 int FrameBorderThickness(bool restored) const; |
| 97 | 97 |
| 98 // Returns the height of the top resize area. This is smaller than the frame | 98 // Returns the height of the top resize area. This is smaller than the frame |
| 99 // border height in order to increase the window draggable area. | 99 // border height in order to increase the window draggable area. |
| 100 int TopResizeHeight() const; | 100 int TopResizeHeight() const; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 124 // also paint the background of the titlebar area, since the top frame border | 124 // also paint the background of the titlebar area, since the top frame border |
| 125 // and titlebar background are a contiguous component. | 125 // and titlebar background are a contiguous component. |
| 126 void PaintRestoredFrameBorder(gfx::Canvas* canvas); | 126 void PaintRestoredFrameBorder(gfx::Canvas* canvas); |
| 127 void PaintMaximizedFrameBorder(gfx::Canvas* canvas); | 127 void PaintMaximizedFrameBorder(gfx::Canvas* canvas); |
| 128 void PaintTitleBar(gfx::Canvas* canvas); | 128 void PaintTitleBar(gfx::Canvas* canvas); |
| 129 void PaintToolbarBackground(gfx::Canvas* canvas); | 129 void PaintToolbarBackground(gfx::Canvas* canvas); |
| 130 void PaintRestoredClientEdge(gfx::Canvas* canvas); | 130 void PaintRestoredClientEdge(gfx::Canvas* canvas); |
| 131 | 131 |
| 132 // Compute aspects of the frame needed to paint the frame background. | 132 // Compute aspects of the frame needed to paint the frame background. |
| 133 SkColor GetFrameColor() const; | 133 SkColor GetFrameColor() const; |
| 134 SkBitmap* GetFrameBitmap() const; | 134 gfx::ImageSkia* GetFrameImage() const; |
| 135 SkBitmap* GetFrameOverlayBitmap() const; | 135 gfx::ImageSkia* GetFrameOverlayImage() const; |
| 136 int GetTopAreaHeight() const; | 136 int GetTopAreaHeight() const; |
| 137 | 137 |
| 138 // Layout various sub-components of this view. | 138 // Layout various sub-components of this view. |
| 139 void LayoutWindowControls(); | 139 void LayoutWindowControls(); |
| 140 void LayoutTitleBar(); | 140 void LayoutTitleBar(); |
| 141 void LayoutAvatar(); | 141 void LayoutAvatar(); |
| 142 | 142 |
| 143 // Returns the bounds of the client area for the specified view size. | 143 // Returns the bounds of the client area for the specified view size. |
| 144 gfx::Rect CalculateClientAreaBounds(int width, int height) const; | 144 gfx::Rect CalculateClientAreaBounds(int width, int height) const; |
| 145 | 145 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 163 | 163 |
| 164 content::NotificationRegistrar registrar_; | 164 content::NotificationRegistrar registrar_; |
| 165 | 165 |
| 166 // Background painter for the window frame. | 166 // Background painter for the window frame. |
| 167 scoped_ptr<views::FrameBackground> frame_background_; | 167 scoped_ptr<views::FrameBackground> frame_background_; |
| 168 | 168 |
| 169 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); | 169 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 172 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |