Index: chrome/browser/ui/views/frame/glass_browser_frame_view.cc |
=================================================================== |
--- chrome/browser/ui/views/frame/glass_browser_frame_view.cc (revision 85284) |
+++ chrome/browser/ui/views/frame/glass_browser_frame_view.cc (working copy) |
@@ -130,8 +130,7 @@ |
// a tab strip until the left end of this window without considering the size |
// of window controls in RTL languages. |
if (base::i18n::IsRTL()) { |
- if (!browser_view_->ShouldShowOffTheRecordAvatar() && |
- frame_->GetWindow()->IsMaximized()) |
+ if (!browser_view_->ShouldShowOffTheRecordAvatar() && frame_->IsMaximized()) |
tabstrip_x += otr_avatar_bounds_.x(); |
minimize_button_offset = width(); |
} |
@@ -141,7 +140,7 @@ |
profile_button_->GetPreferredSize().width() + |
ProfileMenuButton::kProfileTagHorizontalSpacing : 0); |
int tabstrip_width = minimize_button_offset - tabstrip_x - |
- (frame_->GetWindow()->IsMaximized() ? |
+ (frame_->IsMaximized() ? |
maximized_spacing : kNewTabCaptionRestoredSpacing); |
return gfx::Rect(tabstrip_x, GetHorizontalTabStripVerticalOffset(false), |
std::max(0, tabstrip_width), |
@@ -178,7 +177,7 @@ |
gfx::Rect GlassBrowserFrameView::GetWindowBoundsForClientBounds( |
const gfx::Rect& client_bounds) const { |
- HWND hwnd = frame_->GetWindow()->GetNativeWindow(); |
+ HWND hwnd = frame_->GetNativeWindow(); |
if (!browser_view_->IsTabStripVisible() && hwnd) { |
// If we don't have a tabstrip, we're either a popup or an app window, in |
// which case we have a standard size non-client area and can just use |
@@ -206,8 +205,7 @@ |
if (!browser_view_->IsBrowserTypeNormal() || !bounds().Contains(point)) |
return HTNOWHERE; |
- int frame_component = |
- frame_->GetWindow()->client_view()->NonClientHitTest(point); |
+ int frame_component = frame_->client_view()->NonClientHitTest(point); |
// See if we're in the sysmenu region. We still have to check the tabstrip |
// first so that clicks in a tab don't get treated as sysmenu clicks. |
@@ -229,7 +227,7 @@ |
int window_component = GetHTComponentForFrame(point, frame_border_thickness, |
nonclient_border_thickness, frame_border_thickness, |
kResizeAreaCornerSize - frame_border_thickness, |
- frame_->GetWindow()->window_delegate()->CanResize()); |
+ frame_->window_delegate()->CanResize()); |
// Fall back to the caption if no other component matches. |
return (window_component == HTNOWHERE) ? HTCAPTION : window_component; |
} |
@@ -254,7 +252,7 @@ |
PaintToolbarBackground(canvas); |
if (browser_view_->ShouldShowOffTheRecordAvatar()) |
PaintOTRAvatar(canvas); |
- if (!frame_->GetWindow()->IsMaximized()) |
+ if (!frame_->IsMaximized()) |
PaintRestoredClientEdge(canvas); |
} |
@@ -267,12 +265,12 @@ |
bool GlassBrowserFrameView::HitTest(const gfx::Point& l) const { |
// The ProfileMenuButton intrudes into the client area when the window is |
// maximized. |
- if (frame_->GetWindow()->IsMaximized() && show_profile_button() && |
+ if (frame_->IsMaximized() && show_profile_button() && |
profile_button_->IsVisible() && |
profile_button_->GetMirroredBounds().Contains(l)) { |
return true; |
} else { |
- return !GetWindow()->client_view()->bounds().Contains(l); |
+ return !frame_->client_view()->bounds().Contains(l); |
} |
} |
@@ -280,14 +278,12 @@ |
// GlassBrowserFrameView, private: |
int GlassBrowserFrameView::FrameBorderThickness() const { |
- views::Window* window = frame_->GetWindow(); |
- return (window->IsMaximized() || window->IsFullscreen()) ? |
+ return (frame_->IsMaximized() || frame_->IsFullscreen()) ? |
0 : GetSystemMetrics(SM_CXSIZEFRAME); |
} |
int GlassBrowserFrameView::NonClientBorderThickness() const { |
- views::Window* window = frame_->GetWindow(); |
- if (window->IsMaximized() || window->IsFullscreen()) |
+ if (frame_->IsMaximized() || frame_->IsFullscreen()) |
return 0; |
return browser_view_->UseVerticalTabs() ? |
@@ -298,7 +294,7 @@ |
int GlassBrowserFrameView::NonClientTopBorderHeight( |
bool restored, |
bool ignore_vertical_tabs) const { |
- if (!restored && frame_->GetWindow()->IsFullscreen()) |
+ if (!restored && frame_->IsFullscreen()) |
return 0; |
// We'd like to use FrameBorderThickness() here, but the maximized Aero glass |
// frame has a 0 frame border around most edges and a CYSIZEFRAME-thick border |
@@ -436,7 +432,7 @@ |
// of how tall the toolbar itself is. |
int client_area_top = browser_view_->UseVerticalTabs() ? |
client_area_bounds.y() : |
- (frame_->GetWindow()->client_view()->y() + |
+ (frame_->client_view()->y() + |
browser_view_->GetToolbarBounds().y() + |
tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER)->height()); |
int client_area_bottom = |
@@ -497,7 +493,7 @@ |
browser_view_->GetTabStripHeight() - kOTRBottomSpacing; |
otr_restored_y = otr_bottom - otr_avatar_icon.height(); |
} |
- int otr_y = frame_->GetWindow()->IsMaximized() ? |
+ int otr_y = frame_->IsMaximized() ? |
(NonClientTopBorderHeight(false, true) + kTabstripTopShadowThickness) : |
otr_restored_y; |
otr_avatar_bounds_.SetRect(otr_x, otr_y, otr_avatar_icon.width(), |
@@ -536,7 +532,7 @@ |
ProfileMenuButton::kProfileTagHorizontalSpacing - |
// - the width of the profile button |
profile_button_->GetPreferredSize().width(); |
- int y_maximized_offset = frame_->GetWindow()->IsMaximized() ? |
+ int y_maximized_offset = frame_->IsMaximized() ? |
kProfileElementMaximizedYOffset : 0; |
profile_button_->SetBounds( |
x_tag, |
@@ -570,7 +566,7 @@ |
throbber_running_ = true; |
throbber_frame_ = 0; |
InitThrobberIcons(); |
- SendMessage(frame_->GetWindow()->GetNativeWindow(), WM_SETICON, |
+ SendMessage(frame_->GetNativeWindow(), WM_SETICON, |
static_cast<WPARAM>(ICON_SMALL), |
reinterpret_cast<LPARAM>(throbber_icons_[throbber_frame_])); |
} |
@@ -592,13 +588,13 @@ |
// Fallback to class icon. |
if (!frame_icon) { |
frame_icon = reinterpret_cast<HICON>(GetClassLongPtr( |
- frame_->GetWindow()->GetNativeWindow(), GCLP_HICONSM)); |
+ frame_->GetNativeWindow(), GCLP_HICONSM)); |
} |
// This will reset the small icon which we set in the throbber code. |
// WM_SETICON with NULL icon restores the icon for title bar but not |
// for taskbar. See http://crbug.com/29996 |
- SendMessage(frame_->GetWindow()->GetNativeWindow(), WM_SETICON, |
+ SendMessage(frame_->GetNativeWindow(), WM_SETICON, |
static_cast<WPARAM>(ICON_SMALL), |
reinterpret_cast<LPARAM>(frame_icon)); |
} |
@@ -606,7 +602,7 @@ |
void GlassBrowserFrameView::DisplayNextThrobberFrame() { |
throbber_frame_ = (throbber_frame_ + 1) % kThrobberIconCount; |
- SendMessage(frame_->GetWindow()->GetNativeWindow(), WM_SETICON, |
+ SendMessage(frame_->GetNativeWindow(), WM_SETICON, |
static_cast<WPARAM>(ICON_SMALL), |
reinterpret_cast<LPARAM>(throbber_icons_[throbber_frame_])); |
} |