| 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_OPAQUE_FRAME_H_ | |
| 6 #define CHROME_BROWSER_VIEWS_FRAME_OPAQUE_FRAME_H_ | |
| 7 | |
| 8 #include "chrome/browser/views/frame/browser_frame.h" | |
| 9 #include "chrome/views/custom_frame_window.h" | |
| 10 | |
| 11 class BrowserView; | |
| 12 namespace views { | |
| 13 class Window; | |
| 14 } | |
| 15 class OpaqueNonClientView; | |
| 16 class TabStrip; | |
| 17 | |
| 18 /////////////////////////////////////////////////////////////////////////////// | |
| 19 // OpaqueFrame | |
| 20 // | |
| 21 // OpaqueFrame is a CustomFrameWindow subclass that in conjunction with | |
| 22 // OpaqueNonClientView provides the window frame on Windows XP and on Windows | |
| 23 // Vista when DWM desktop compositing is disabled. The window title and | |
| 24 // borders are provided with bitmaps. | |
| 25 // | |
| 26 class OpaqueFrame : public BrowserFrame, | |
| 27 public views::CustomFrameWindow { | |
| 28 public: | |
| 29 explicit OpaqueFrame(BrowserView* browser_view); | |
| 30 virtual ~OpaqueFrame(); | |
| 31 | |
| 32 void Init(); | |
| 33 | |
| 34 protected: | |
| 35 // Overridden from BrowserFrame: | |
| 36 virtual gfx::Rect GetWindowBoundsForClientBounds( | |
| 37 const gfx::Rect& client_bounds); | |
| 38 virtual void SizeToContents(const gfx::Rect& contents_bounds); | |
| 39 virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; | |
| 40 virtual void UpdateThrobber(bool running); | |
| 41 virtual views::Window* GetWindow(); | |
| 42 virtual const views::Window* GetWindow() const; | |
| 43 | |
| 44 // Overridden from views::CustomFrameWindow: | |
| 45 virtual void UpdateWindowIcon(); | |
| 46 virtual int GetShowState() const; | |
| 47 virtual bool IsAppWindow() const { return true; } | |
| 48 | |
| 49 // Overridden from views::WidgetWin: | |
| 50 virtual bool AcceleratorPressed(views::Accelerator* accelerator); | |
| 51 virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); | |
| 52 virtual void OnEnterSizeMove(); | |
| 53 virtual void OnEndSession(BOOL ending, UINT logoff); | |
| 54 virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); | |
| 55 virtual LRESULT OnMouseActivate(HWND window, | |
| 56 UINT hittest_code, | |
| 57 UINT message); | |
| 58 virtual void OnMove(const CPoint& point); | |
| 59 virtual void OnMoving(UINT param, const RECT* new_bounds); | |
| 60 virtual LRESULT OnNCActivate(BOOL active); | |
| 61 virtual void OnSysCommand(UINT notification_code, CPoint click); | |
| 62 | |
| 63 private: | |
| 64 // Return a pointer to the concrete type of our non-client view. | |
| 65 OpaqueNonClientView* GetOpaqueNonClientView() const; | |
| 66 | |
| 67 // The BrowserView is our ClientView. This is a pointer to it. | |
| 68 BrowserView* browser_view_; | |
| 69 | |
| 70 DISALLOW_EVIL_CONSTRUCTORS(OpaqueFrame); | |
| 71 }; | |
| 72 | |
| 73 #endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_OPAQUE_FRAME_H_ | |
| 74 | |
| OLD | NEW |