summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame/aero_glass_frame.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 00:28:00 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 00:28:00 +0000
commit32670b07a6c42634f446e3d471f42a9fb40090f2 (patch)
tree77b15435f3a436d54fcaa5cb4c0d4371a007fad6 /chrome/browser/views/frame/aero_glass_frame.h
parenta0e5688cc11f7f5e835b5c1a75c17ce4a28a1527 (diff)
downloadchromium_src-32670b07a6c42634f446e3d471f42a9fb40090f2.zip
chromium_src-32670b07a6c42634f446e3d471f42a9fb40090f2.tar.gz
chromium_src-32670b07a6c42634f446e3d471f42a9fb40090f2.tar.bz2
Support DWM switching.
This completes the collapsing of window types and browser frames around a single class: views::Window. CustomFrameWindow is removed with this change. The Browser window is represented by a single views::Window subclass: BrowserFrame, which replaces both AeroGlassFrame and OpaqueFrame. NonClientView is now a container of two sibling classes - the Window's ClientView (in the Browser's case, BrowserView), and a NonClientFrameView subclass, which provides the rendering for the non-client portions of the window. These Views are siblings rather than the ClientView a child of the NonClientFrameView because when the DWM is toggled, the ClientView would have to be re-parented. Many Views make the assumption they are only inserted into a View hierarchy once, and so this is problematic. By having the views be siblings, this is avoided. With this in mind, all of the former NonClientViews now become NonClientFrameView subclasses: DefaultNonClientView -> CustomFrameView (non-existent, NonClientView) -> NativeFrameView AeroGlassNonClientView -> GlassBrowserFrameView OpaqueNonClientView -> OpaqueBrowserFrameView The latter two derive from NonClientFrameView via BrowserNonClientFrameView, which adds some extras. I also had to modify the TabRenderer class to know how to drop its cache of tab background images when the theme changes since it uses different ones for Glass and non-Glass. This change also fixes a few non-client flicker issues relating to window non-client activation by using more ScopedRedrawLocks. (Touches info_bubble.cc, window.cc) Bugs fixed: http://crbug.com/153 http://crbug.com/747 http://crbug.com/2371 http://crbug.com/3264 http://crbug.com/8234 Plumbing for http://crbug.com/8247 Design docs: http://dev.chromium.org/developers/design-documents/views-windowing http://dev.chromium.org/developers/design-documents/browser-window Review URL: http://codereview.chromium.org/27317 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10757 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame/aero_glass_frame.h')
-rw-r--r--chrome/browser/views/frame/aero_glass_frame.h95
1 files changed, 0 insertions, 95 deletions
diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h
deleted file mode 100644
index 4c7e2f8..0000000
--- a/chrome/browser/views/frame/aero_glass_frame.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_
-#define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_
-
-#include "chrome/browser/views/frame/browser_frame.h"
-#include "chrome/views/window.h"
-
-class AeroGlassNonClientView;
-class BrowserView;
-
-///////////////////////////////////////////////////////////////////////////////
-// AeroGlassFrame
-//
-// AeroGlassFrame is a Window subclass that provides the window frame on
-// Windows Vista with DWM desktop compositing enabled. The window's non-client
-// areas are drawn by the system.
-//
-class AeroGlassFrame : public BrowserFrame,
- public views::Window {
- public:
- explicit AeroGlassFrame(BrowserView* browser_view);
- virtual ~AeroGlassFrame();
-
- void Init();
-
- // Determine the distance of the left edge of the minimize button from the
- // left edge of the window. Used in our Non-Client View's Layout.
- int GetMinimizeButtonOffset() const;
-
- // Overridden from BrowserFrame:
- virtual gfx::Rect GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds);
- virtual void SizeToContents(const gfx::Rect& contents_bounds) {}
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const;
- virtual void UpdateThrobber(bool running);
- virtual views::Window* GetWindow();
- virtual const views::Window* GetWindow() const;
-
- protected:
- // Overridden from views::WidgetWin:
- virtual bool AcceleratorPressed(views::Accelerator* accelerator);
- virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator);
- virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu);
- virtual void OnEnterSizeMove();
- virtual void OnEndSession(BOOL ending, UINT logoff);
- virtual LRESULT OnMouseActivate(HWND window,
- UINT hittest_code,
- UINT message);
- virtual void OnMove(const CPoint& point);
- virtual void OnMoving(UINT param, const RECT* new_bounds);
- virtual LRESULT OnNCActivate(BOOL active);
- virtual LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param);
- virtual LRESULT OnNCHitTest(const CPoint& pt);
-
- // Overridden from views::Window:
- virtual int GetShowState() const;
- virtual bool IsAppWindow() const { return true; }
-
- private:
- // Updates the DWM with the frame bounds.
- void UpdateDWMFrame();
-
- // Return a pointer to the concrete type of our non-client view.
- AeroGlassNonClientView* GetAeroGlassNonClientView() const;
-
- // Starts/Stops the window throbber running.
- void StartThrobber();
- void StopThrobber();
-
- // Displays the next throbber frame.
- void DisplayNextThrobberFrame();
-
- // The BrowserView is our ClientView. This is a pointer to it.
- BrowserView* browser_view_;
-
- bool frame_initialized_;
-
- // Whether or not the window throbber is currently animating.
- bool throbber_running_;
-
- // The index of the current frame of the throbber animation.
- int throbber_frame_;
-
- static const int kThrobberIconCount = 24;
- static HICON throbber_icons_[kThrobberIconCount];
- static void InitThrobberIcons();
-
- DISALLOW_EVIL_CONSTRUCTORS(AeroGlassFrame);
-};
-
-#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_
-