summaryrefslogtreecommitdiffstats
path: root/chrome/views/custom_frame_view.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 21:24:42 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 21:24:42 +0000
commita04f125f5fe5bbc56a3feaac4121a29452becedf (patch)
tree5121b9ab8c64747b940babce8f962ac70e1b1fc9 /chrome/views/custom_frame_view.cc
parentb19f1cd7bf78c0d8cf23483d4bbf82466d93372e (diff)
downloadchromium_src-a04f125f5fe5bbc56a3feaac4121a29452becedf.zip
chromium_src-a04f125f5fe5bbc56a3feaac4121a29452becedf.tar.gz
chromium_src-a04f125f5fe5bbc56a3feaac4121a29452becedf.tar.bz2
revert
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/custom_frame_view.cc')
-rw-r--r--chrome/views/custom_frame_view.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/chrome/views/custom_frame_view.cc b/chrome/views/custom_frame_view.cc
index d9db4b2..316d7a4 100644
--- a/chrome/views/custom_frame_view.cc
+++ b/chrome/views/custom_frame_view.cc
@@ -260,7 +260,7 @@ CustomFrameView::CustomFrameView(Window* frame)
minimize_button_->SetListener(this, -1);
AddChildView(minimize_button_);
- should_show_minmax_buttons_ = frame_->GetDelegate()->CanMaximize();
+ should_show_minmax_buttons_ = frame_->window_delegate()->CanMaximize();
AddChildView(system_menu_button_);
}
@@ -311,7 +311,7 @@ int CustomFrameView::NonClientHitTest(const gfx::Point& point) {
int window_component = GetHTComponentForFrame(point, FrameBorderThickness(),
NonClientBorderThickness(), kResizeAreaCornerSize, kResizeAreaCornerSize,
- frame_->GetDelegate()->CanResize());
+ frame_->window_delegate()->CanResize());
// Fall back to the caption if no other component matches.
return (window_component == HTNOWHERE) ? HTCAPTION : window_component;
}
@@ -370,11 +370,10 @@ void CustomFrameView::Layout() {
}
gfx::Size CustomFrameView::GetPreferredSize() {
- gfx::Size pref = frame_->GetClientView()->GetPreferredSize();
+ gfx::Size pref = frame_->client_view()->GetPreferredSize();
DCHECK(pref.width() > 0 && pref.height() > 0);
gfx::Rect bounds(0, 0, pref.width(), pref.height());
- return frame_->GetNonClientView()->GetWindowBoundsForClientBounds(
- bounds).size();
+ return frame_->GetWindowBoundsForClientBounds(bounds).size();
}
///////////////////////////////////////////////////////////////////////////////
@@ -382,13 +381,13 @@ gfx::Size CustomFrameView::GetPreferredSize() {
void CustomFrameView::ButtonPressed(BaseButton* sender) {
if (sender == close_button_)
- frame_->Close();
+ frame_->ExecuteSystemMenuCommand(SC_CLOSE);
else if (sender == minimize_button_)
- frame_->Minimize();
+ frame_->ExecuteSystemMenuCommand(SC_MINIMIZE);
else if (sender == maximize_button_)
- frame_->Maximize();
+ frame_->ExecuteSystemMenuCommand(SC_MAXIMIZE);
else if (sender == restore_button_)
- frame_->Restore();
+ frame_->ExecuteSystemMenuCommand(SC_RESTORE);
}
///////////////////////////////////////////////////////////////////////////////
@@ -495,11 +494,11 @@ void CustomFrameView::PaintMaximizedFrameBorder(
SkBitmap* titlebar_bottom = resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP);
int edge_height = titlebar_bottom->height() - kClientEdgeThickness;
canvas->TileImageInt(*titlebar_bottom, 0,
- frame_->GetClientView()->y() - edge_height, width(), edge_height);
+ frame_->client_view()->y() - edge_height, width(), edge_height);
}
void CustomFrameView::PaintTitleBar(ChromeCanvas* canvas) {
- WindowDelegate* d = frame_->GetDelegate();
+ WindowDelegate* d = frame_->window_delegate();
// It seems like in some conditions we can be asked to paint after the window
// that contains us is WM_DESTROYed. At this point, our delegate is NULL. The
@@ -513,7 +512,7 @@ void CustomFrameView::PaintTitleBar(ChromeCanvas* canvas) {
}
void CustomFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
- gfx::Rect client_area_bounds = frame_->GetClientView()->bounds();
+ gfx::Rect client_area_bounds = frame_->client_view()->bounds();
int client_area_top = client_area_bounds.y();
SkBitmap* top_left = resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT);
@@ -656,7 +655,7 @@ void CustomFrameView::LayoutTitleBar() {
if (!frame_->IsMaximized())
icon_y -= kIconRestoredAdjust;
- views::WindowDelegate* d = frame_->GetDelegate();
+ views::WindowDelegate* d = frame_->window_delegate();
if (!d->ShouldShowWindowIcon())
icon_size = 0;
system_menu_button_->SetBounds(icon_x, icon_y, icon_size, icon_size);