OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_FRAME_AERO_GLASS_FRAME_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ |
6 #define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ | 6 #define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ |
7 | 7 |
8 #include "chrome/browser/views/frame/browser_frame.h" | 8 #include "chrome/browser/views/frame/browser_frame.h" |
9 #include "chrome/views/window.h" | 9 #include "chrome/views/window.h" |
10 | 10 |
11 class AeroGlassNonClientView; | 11 class AeroGlassNonClientView; |
12 class BrowserView; | 12 class BrowserView; |
13 | 13 |
14 /////////////////////////////////////////////////////////////////////////////// | 14 /////////////////////////////////////////////////////////////////////////////// |
15 // AeroGlassFrame | 15 // AeroGlassFrame |
16 // | 16 // |
17 // AeroGlassFrame is a Window subclass that provides the window frame on | 17 // AeroGlassFrame is a Window subclass that provides the window frame on |
18 // Windows Vista with DWM desktop compositing enabled. The window's non-client | 18 // Windows Vista with DWM desktop compositing enabled. The window's non-client |
19 // areas are drawn by the system. | 19 // areas are drawn by the system. |
20 // | 20 // |
21 class AeroGlassFrame : public BrowserFrame, | 21 class AeroGlassFrame : public BrowserFrame, |
22 public views::Window { | 22 public views::Window { |
23 public: | 23 public: |
24 explicit AeroGlassFrame(BrowserView* browser_view); | 24 explicit AeroGlassFrame(BrowserView* browser_view); |
25 virtual ~AeroGlassFrame(); | 25 virtual ~AeroGlassFrame(); |
26 | 26 |
27 void Init(const gfx::Rect& bounds); | 27 void Init(); |
28 | 28 |
29 // Determine the distance of the left edge of the minimize button from the | 29 // Determine the distance of the left edge of the minimize button from the |
30 // right edge of the window. Used in our Non-Client View's Layout. | 30 // right edge of the window. Used in our Non-Client View's Layout. |
31 int GetMinimizeButtonOffset() const; | 31 int GetMinimizeButtonOffset() const; |
32 | 32 |
33 // Overridden from BrowserFrame: | 33 // Overridden from BrowserFrame: |
34 virtual gfx::Rect GetWindowBoundsForClientBounds( | 34 virtual gfx::Rect GetWindowBoundsForClientBounds( |
35 const gfx::Rect& client_bounds); | 35 const gfx::Rect& client_bounds); |
36 virtual void SizeToContents(const gfx::Rect& contents_bounds) {} | 36 virtual void SizeToContents(const gfx::Rect& contents_bounds) {} |
37 virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; | 37 virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; |
38 virtual void UpdateThrobber(bool running); | 38 virtual void UpdateThrobber(bool running); |
39 virtual views::Window* GetWindow(); | 39 virtual views::Window* GetWindow(); |
40 | 40 |
| 41 protected: |
41 // Overridden from views::ContainerWin: | 42 // Overridden from views::ContainerWin: |
42 virtual bool AcceleratorPressed(views::Accelerator* accelerator); | 43 virtual bool AcceleratorPressed(views::Accelerator* accelerator); |
43 virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); | 44 virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); |
44 | |
45 protected: | |
46 // Overridden from views::ContainerWin: | |
47 virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); | 45 virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); |
48 virtual void OnEndSession(BOOL ending, UINT logoff); | 46 virtual void OnEndSession(BOOL ending, UINT logoff); |
49 virtual LRESULT OnMouseActivate(HWND window, | 47 virtual LRESULT OnMouseActivate(HWND window, |
50 UINT hittest_code, | 48 UINT hittest_code, |
51 UINT message); | 49 UINT message); |
52 virtual void OnMove(const CPoint& point); | 50 virtual void OnMove(const CPoint& point); |
53 virtual void OnMoving(UINT param, const RECT* new_bounds); | 51 virtual void OnMoving(UINT param, const RECT* new_bounds); |
54 virtual LRESULT OnNCActivate(BOOL active); | 52 virtual LRESULT OnNCActivate(BOOL active); |
55 virtual LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); | 53 virtual LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); |
56 virtual LRESULT OnNCHitTest(const CPoint& pt); | 54 virtual LRESULT OnNCHitTest(const CPoint& pt); |
57 | 55 |
| 56 // Overridden from views::CustomFrameWindow: |
| 57 virtual int GetShowState() const; |
| 58 |
58 private: | 59 private: |
59 // Updates the DWM with the frame bounds. | 60 // Updates the DWM with the frame bounds. |
60 void UpdateDWMFrame(); | 61 void UpdateDWMFrame(); |
61 | 62 |
62 // Return a pointer to the concrete type of our non-client view. | 63 // Return a pointer to the concrete type of our non-client view. |
63 AeroGlassNonClientView* GetAeroGlassNonClientView() const; | 64 AeroGlassNonClientView* GetAeroGlassNonClientView() const; |
64 | 65 |
65 // Starts/Stops the window throbber running. | 66 // Starts/Stops the window throbber running. |
66 void StartThrobber(); | 67 void StartThrobber(); |
67 void StopThrobber(); | 68 void StopThrobber(); |
(...skipping 14 matching lines...) Expand all Loading... |
82 | 83 |
83 static const int kThrobberIconCount = 24; | 84 static const int kThrobberIconCount = 24; |
84 static HICON throbber_icons_[kThrobberIconCount]; | 85 static HICON throbber_icons_[kThrobberIconCount]; |
85 static void InitThrobberIcons(); | 86 static void InitThrobberIcons(); |
86 | 87 |
87 DISALLOW_EVIL_CONSTRUCTORS(AeroGlassFrame); | 88 DISALLOW_EVIL_CONSTRUCTORS(AeroGlassFrame); |
88 }; | 89 }; |
89 | 90 |
90 #endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ | 91 #endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ |
91 | 92 |
OLD | NEW |