| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/frame/browser_frame.h" | 9 #include "chrome/browser/ui/views/frame/browser_frame.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" | 
| 11 #include "chrome/browser/ui/views/tab_icon_view.h" | 11 #include "chrome/browser/ui/views/tab_icon_view.h" | 
| 12 #include "views/controls/button/button.h" | 12 #include "views/controls/button/button.h" | 
| 13 #include "views/window/non_client_view.h" | 13 #include "views/window/non_client_view.h" | 
| 14 | 14 | 
| 15 class BrowserView; | 15 class BrowserView; | 
| 16 namespace gfx { | 16 namespace gfx { | 
| 17 class Font; | 17 class Font; | 
| 18 } | 18 } | 
| 19 class TabContents; | 19 class TabContents; | 
| 20 namespace views { | 20 namespace views { | 
| 21 class ImageButton; | 21 class ImageButton; | 
| 22 class ImageView; | 22 class ImageView; | 
| 23 } | 23 } | 
| 24 | 24 | 
|  | 25 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 
|  | 26 namespace chromeos { | 
|  | 27 class DOMBrowserFrameView; | 
|  | 28 } | 
|  | 29 #endif | 
|  | 30 | 
| 25 class OpaqueBrowserFrameView : public BrowserNonClientFrameView, | 31 class OpaqueBrowserFrameView : public BrowserNonClientFrameView, | 
| 26                                public views::ButtonListener, | 32                                public views::ButtonListener, | 
| 27                                public TabIconView::TabIconViewModel { | 33                                public TabIconView::TabIconViewModel { | 
| 28  public: | 34  public: | 
| 29   // Constructs a non-client view for an BrowserFrame. | 35   // Constructs a non-client view for an BrowserFrame. | 
| 30   OpaqueBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 36   OpaqueBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 
| 31   virtual ~OpaqueBrowserFrameView(); | 37   virtual ~OpaqueBrowserFrameView(); | 
| 32 | 38 | 
| 33   // Overridden from BrowserNonClientFrameView: | 39   // Overridden from BrowserNonClientFrameView: | 
| 34   virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; | 40   virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 62   virtual AccessibilityTypes::Role GetAccessibleRole(); | 68   virtual AccessibilityTypes::Role GetAccessibleRole(); | 
| 63 | 69 | 
| 64   // Overridden from views::ButtonListener: | 70   // Overridden from views::ButtonListener: | 
| 65   virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 71   virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 
| 66 | 72 | 
| 67   // Overridden from TabIconView::TabIconViewModel: | 73   // Overridden from TabIconView::TabIconViewModel: | 
| 68   virtual bool ShouldTabIconViewAnimate() const; | 74   virtual bool ShouldTabIconViewAnimate() const; | 
| 69   virtual SkBitmap GetFavIconForTabIconView(); | 75   virtual SkBitmap GetFavIconForTabIconView(); | 
| 70 | 76 | 
| 71  private: | 77  private: | 
|  | 78 | 
|  | 79 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 
|  | 80   friend class chromeos::DOMBrowserFrameView; | 
|  | 81 #endif | 
|  | 82 | 
| 72   // Returns the thickness of the border that makes up the window frame edges. | 83   // Returns the thickness of the border that makes up the window frame edges. | 
| 73   // This does not include any client edge.  If |restored| is true, acts as if | 84   // This does not include any client edge.  If |restored| is true, acts as if | 
| 74   // the window is restored regardless of the real mode. | 85   // the window is restored regardless of the real mode. | 
| 75   int FrameBorderThickness(bool restored) const; | 86   int FrameBorderThickness(bool restored) const; | 
| 76 | 87 | 
| 77   // Returns the height of the top resize area.  This is smaller than the frame | 88   // Returns the height of the top resize area.  This is smaller than the frame | 
| 78   // border height in order to increase the window draggable area. | 89   // border height in order to increase the window draggable area. | 
| 79   int TopResizeHeight() const; | 90   int TopResizeHeight() const; | 
| 80 | 91 | 
| 81   // Returns the thickness of the entire nonclient left, right, and bottom | 92   // Returns the thickness of the entire nonclient left, right, and bottom | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
| 112   void PaintRestoredFrameBorder(gfx::Canvas* canvas); | 123   void PaintRestoredFrameBorder(gfx::Canvas* canvas); | 
| 113   void PaintMaximizedFrameBorder(gfx::Canvas* canvas); | 124   void PaintMaximizedFrameBorder(gfx::Canvas* canvas); | 
| 114   void PaintTitleBar(gfx::Canvas* canvas); | 125   void PaintTitleBar(gfx::Canvas* canvas); | 
| 115   void PaintToolbarBackground(gfx::Canvas* canvas); | 126   void PaintToolbarBackground(gfx::Canvas* canvas); | 
| 116   void PaintOTRAvatar(gfx::Canvas* canvas); | 127   void PaintOTRAvatar(gfx::Canvas* canvas); | 
| 117   void PaintRestoredClientEdge(gfx::Canvas* canvas); | 128   void PaintRestoredClientEdge(gfx::Canvas* canvas); | 
| 118 | 129 | 
| 119   // Layout various sub-components of this view. | 130   // Layout various sub-components of this view. | 
| 120   void LayoutWindowControls(); | 131   void LayoutWindowControls(); | 
| 121   void LayoutTitleBar(); | 132   void LayoutTitleBar(); | 
| 122   void LayoutOTRAvatar(); | 133   virtual void LayoutOTRAvatar(); | 
| 123 | 134 | 
| 124   // Returns the bounds of the client area for the specified view size. | 135   // Returns the bounds of the client area for the specified view size. | 
| 125   gfx::Rect CalculateClientAreaBounds(int width, int height) const; | 136   gfx::Rect CalculateClientAreaBounds(int width, int height) const; | 
| 126 | 137 | 
| 127   // The layout rect of the title, if visible. | 138   // The layout rect of the title, if visible. | 
| 128   gfx::Rect title_bounds_; | 139   gfx::Rect title_bounds_; | 
| 129 | 140 | 
| 130   // The layout rect of the OTR avatar icon, if visible. | 141   // The layout rect of the OTR avatar icon, if visible. | 
| 131   gfx::Rect otr_avatar_bounds_; | 142   gfx::Rect otr_avatar_bounds_; | 
| 132 | 143 | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 145   // The BrowserView hosted within this View. | 156   // The BrowserView hosted within this View. | 
| 146   BrowserView* browser_view_; | 157   BrowserView* browser_view_; | 
| 147 | 158 | 
| 148   // The bounds of the ClientView. | 159   // The bounds of the ClientView. | 
| 149   gfx::Rect client_view_bounds_; | 160   gfx::Rect client_view_bounds_; | 
| 150 | 161 | 
| 151   DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); | 162   DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); | 
| 152 }; | 163 }; | 
| 153 | 164 | 
| 154 #endif  // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 165 #endif  // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 
| OLD | NEW | 
|---|