OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ | |
6 #define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ | |
7 | |
8 #include "chrome/browser/views/frame/browser_frame.h" | |
9 #include "chrome/views/window.h" | |
10 | |
11 class AeroGlassNonClientView; | |
12 class BrowserView; | |
13 | |
14 /////////////////////////////////////////////////////////////////////////////// | |
15 // AeroGlassFrame | |
16 // | |
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 | |
19 // areas are drawn by the system. | |
20 // | |
21 class AeroGlassFrame : public BrowserFrame, | |
22 public views::Window { | |
23 public: | |
24 explicit AeroGlassFrame(BrowserView* browser_view); | |
25 virtual ~AeroGlassFrame(); | |
26 | |
27 void Init(); | |
28 | |
29 // Determine the distance of the left edge of the minimize button from the | |
30 // left edge of the window. Used in our Non-Client View's Layout. | |
31 int GetMinimizeButtonOffset() const; | |
32 | |
33 // Overridden from BrowserFrame: | |
34 virtual gfx::Rect GetWindowBoundsForClientBounds( | |
35 const gfx::Rect& client_bounds); | |
36 virtual void SizeToContents(const gfx::Rect& contents_bounds) {} | |
37 virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; | |
38 virtual void UpdateThrobber(bool running); | |
39 virtual views::Window* GetWindow(); | |
40 virtual const views::Window* GetWindow() const; | |
41 | |
42 protected: | |
43 // Overridden from views::WidgetWin: | |
44 virtual bool AcceleratorPressed(views::Accelerator* accelerator); | |
45 virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); | |
46 virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); | |
47 virtual void OnEnterSizeMove(); | |
48 virtual void OnEndSession(BOOL ending, UINT logoff); | |
49 virtual LRESULT OnMouseActivate(HWND window, | |
50 UINT hittest_code, | |
51 UINT message); | |
52 virtual void OnMove(const CPoint& point); | |
53 virtual void OnMoving(UINT param, const RECT* new_bounds); | |
54 virtual LRESULT OnNCActivate(BOOL active); | |
55 virtual LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); | |
56 virtual LRESULT OnNCHitTest(const CPoint& pt); | |
57 | |
58 // Overridden from views::Window: | |
59 virtual int GetShowState() const; | |
60 virtual bool IsAppWindow() const { return true; } | |
61 | |
62 private: | |
63 // Updates the DWM with the frame bounds. | |
64 void UpdateDWMFrame(); | |
65 | |
66 // Return a pointer to the concrete type of our non-client view. | |
67 AeroGlassNonClientView* GetAeroGlassNonClientView() const; | |
68 | |
69 // Starts/Stops the window throbber running. | |
70 void StartThrobber(); | |
71 void StopThrobber(); | |
72 | |
73 // Displays the next throbber frame. | |
74 void DisplayNextThrobberFrame(); | |
75 | |
76 // The BrowserView is our ClientView. This is a pointer to it. | |
77 BrowserView* browser_view_; | |
78 | |
79 bool frame_initialized_; | |
80 | |
81 // Whether or not the window throbber is currently animating. | |
82 bool throbber_running_; | |
83 | |
84 // The index of the current frame of the throbber animation. | |
85 int throbber_frame_; | |
86 | |
87 static const int kThrobberIconCount = 24; | |
88 static HICON throbber_icons_[kThrobberIconCount]; | |
89 static void InitThrobberIcons(); | |
90 | |
91 DISALLOW_EVIL_CONSTRUCTORS(AeroGlassFrame); | |
92 }; | |
93 | |
94 #endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ | |
95 | |
OLD | NEW |