diff options
Diffstat (limited to 'chrome/browser/views')
4 files changed, 36 insertions, 1 deletions
diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc index b3db14e..4154cc4 100644 --- a/chrome/browser/views/frame/aero_glass_frame.cc +++ b/chrome/browser/views/frame/aero_glass_frame.cc @@ -49,7 +49,7 @@ static const int kToolbarOverlapVertOffset = 3; static const int kDwmBorderSize = 1; /////////////////////////////////////////////////////////////////////////////// -// OpaqueFrame, public: +// AeroGlassFrame, public: AeroGlassFrame::AeroGlassFrame(BrowserView2* browser_view) : Window(browser_view), @@ -88,6 +88,10 @@ int AeroGlassFrame::GetMinimizeButtonOffset() const { /////////////////////////////////////////////////////////////////////////////// // AeroGlassFrame, BrowserFrame implementation: +gfx::Rect AeroGlassFrame::GetBoundsForTabStrip(TabStrip* tabstrip) const { + return GetAeroGlassNonClientView()->GetBoundsForTabStrip(tabstrip); +} + ChromeViews::Window* AeroGlassFrame::GetWindow() { return this; } @@ -171,3 +175,8 @@ void AeroGlassFrame::UpdateDWMFrame() { kDwmBorderSize + bottom_edge.height() }; DwmExtendFrameIntoClientArea(GetHWND(), &margins); } + +AeroGlassNonClientView* AeroGlassFrame::GetAeroGlassNonClientView() const { + // We can safely assume that this conversion is true. + return static_cast<AeroGlassNonClientView*>(non_client_view_); +} diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h index df0d90ea..5480d5d 100644 --- a/chrome/browser/views/frame/aero_glass_frame.h +++ b/chrome/browser/views/frame/aero_glass_frame.h @@ -33,6 +33,7 @@ #include "chrome/browser/views/frame/browser_frame.h" #include "chrome/views/window.h" +class AeroGlassNonClientView; class BrowserView2; /////////////////////////////////////////////////////////////////////////////// @@ -62,6 +63,7 @@ class AeroGlassFrame : public BrowserFrame, int GetMinimizeButtonOffset() const; // Overridden from BrowserFrame: + virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual ChromeViews::Window* GetWindow(); protected: @@ -74,6 +76,9 @@ class AeroGlassFrame : public BrowserFrame, // Updates the DWM with the frame bounds. void UpdateDWMFrame(); + // Return a pointer to the concrete type of our non-client view. + AeroGlassNonClientView* GetAeroGlassNonClientView() const; + // The BrowserView2 is our ClientView. This is a pointer to it. BrowserView2* browser_view_; diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc index e298639..0e05ab9 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.cc +++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc @@ -30,6 +30,7 @@ #include "chrome/browser/views/frame/aero_glass_non_client_view.h" #include "chrome/app/theme/theme_resources.h" +#include "chrome/browser/tabs/tab_strip.h" #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/chrome_font.h" #include "chrome/common/gfx/path.h" @@ -121,6 +122,7 @@ static const int kWindowHorizontalBorderSize = 2; static const int kWindowVerticalBorderSize = 2; static const int kDistributorLogoHorizontalOffset = 7; static const int kDistributorLogoVerticalOffset = 3; +static const int kTitlebarHeight = 14; /////////////////////////////////////////////////////////////////////////////// // AeroGlassNonClientView, public: @@ -133,6 +135,23 @@ AeroGlassNonClientView::AeroGlassNonClientView(AeroGlassFrame* frame) AeroGlassNonClientView::~AeroGlassNonClientView() { } +gfx::Rect AeroGlassNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) { + // If we are maximized, the tab strip will be in line with the window + // controls, so we need to make sure they don't overlap. + int tabstrip_width = GetWidth(); + if(frame_->IsMaximized()) { + TITLEBARINFOEX titlebar_info; + titlebar_info.cbSize = sizeof(TITLEBARINFOEX); + SendMessage(frame_->GetHWND(), WM_GETTITLEBARINFOEX, 0, + reinterpret_cast<WPARAM>(&titlebar_info)); + + // rgrect[2] refers to the minimize button. + tabstrip_width -= (tabstrip_width - titlebar_info.rgrect[2].left); + } + int tabstrip_height = tabstrip->GetPreferredHeight(); + return gfx::Rect(0, kTitlebarHeight, tabstrip_width, tabstrip_height); +} + /////////////////////////////////////////////////////////////////////////////// // AeroGlassNonClientView, ChromeViews::NonClientView implementation: diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.h b/chrome/browser/views/frame/aero_glass_non_client_view.h index eea2e0b..8b354bf 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.h +++ b/chrome/browser/views/frame/aero_glass_non_client_view.h @@ -42,6 +42,8 @@ class AeroGlassNonClientView : public ChromeViews::NonClientView { explicit AeroGlassNonClientView(AeroGlassFrame* frame); virtual ~AeroGlassNonClientView(); + gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip); + protected: // Overridden from ChromeViews::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; |