diff options
Diffstat (limited to 'views/window')
-rw-r--r-- | views/window/custom_frame_view.cc | 20 | ||||
-rw-r--r-- | views/window/window_shape.cc | 46 | ||||
-rw-r--r-- | views/window/window_shape.h | 21 |
3 files changed, 18 insertions, 69 deletions
diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc index e67a5c2..5f62219 100644 --- a/views/window/custom_frame_view.cc +++ b/views/window/custom_frame_view.cc @@ -17,7 +17,6 @@ #include "grit/app_resources.h" #include "grit/app_strings.h" #include "views/window/client_view.h" -#include "views/window/window_shape.h" #if defined(OS_LINUX) #include "views/window/hit_test.h" #endif @@ -188,10 +187,27 @@ int CustomFrameView::NonClientHitTest(const gfx::Point& point) { void CustomFrameView::GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) { DCHECK(window_mask); + if (frame_->IsMaximized()) return; - views::GetDefaultWindowMask(size, window_mask); + // Redefine the window visible region for the new size. + window_mask->moveTo(0, 3); + window_mask->lineTo(1, 2); + window_mask->lineTo(1, 1); + window_mask->lineTo(2, 1); + window_mask->lineTo(3, 0); + + window_mask->lineTo(SkIntToScalar(size.width() - 3), 0); + window_mask->lineTo(SkIntToScalar(size.width() - 2), 1); + window_mask->lineTo(SkIntToScalar(size.width() - 1), 1); + window_mask->lineTo(SkIntToScalar(size.width() - 1), 2); + window_mask->lineTo(SkIntToScalar(size.width()), 3); + + window_mask->lineTo(SkIntToScalar(size.width()), + SkIntToScalar(size.height())); + window_mask->lineTo(0, SkIntToScalar(size.height())); + window_mask->close(); } void CustomFrameView::EnableClose(bool enable) { diff --git a/views/window/window_shape.cc b/views/window/window_shape.cc deleted file mode 100644 index dd234bf..0000000 --- a/views/window/window_shape.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2010 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. - -#include "views/window/window_shape.h" - -#include "gfx/path.h" -#include "gfx/size.h" - -namespace views { - -void GetDefaultWindowMask(const gfx::Size &size, gfx::Path *window_mask) { - // Redefine the window visible region for the new size. - window_mask->moveTo(0, 3); - window_mask->lineTo(1, 2); - window_mask->lineTo(1, 1); - window_mask->lineTo(2, 1); - window_mask->lineTo(3, 0); - - window_mask->lineTo(SkIntToScalar(size.width() - 3), 0); - window_mask->lineTo(SkIntToScalar(size.width() - 2), 1); - window_mask->lineTo(SkIntToScalar(size.width() - 1), 1); - window_mask->lineTo(SkIntToScalar(size.width() - 1), 2); - window_mask->lineTo(SkIntToScalar(size.width()), 3); - - window_mask->lineTo(SkIntToScalar(size.width()), - SkIntToScalar(size.height() - 3)); - window_mask->lineTo(SkIntToScalar(size.width() - 1), - SkIntToScalar(size.height() - 3)); - window_mask->lineTo(SkIntToScalar(size.width() - 1), - SkIntToScalar(size.height() - 1)); - window_mask->lineTo(SkIntToScalar(size.width() - 3), - SkIntToScalar(size.height() - 2)); - window_mask->lineTo(SkIntToScalar(size.width() - 3), - SkIntToScalar(size.height())); - - window_mask->lineTo(3, SkIntToScalar(size.height())); - window_mask->lineTo(2, SkIntToScalar(size.height() - 2)); - window_mask->lineTo(1, SkIntToScalar(size.height() - 1)); - window_mask->lineTo(1, SkIntToScalar(size.height() - 3)); - window_mask->lineTo(0, SkIntToScalar(size.height() - 3)); - - window_mask->close(); -} - -} // namespace views diff --git a/views/window/window_shape.h b/views/window/window_shape.h deleted file mode 100644 index 5b47415..0000000 --- a/views/window/window_shape.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2010 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 VIEWS_WINDOW_WINDOW_SHAPE_H_ -#define VIEWS_WINDOW_WINDOW_SHAPE_H_ - -namespace gfx { -class Size; -class Path; -} - -namespace views { - -// Sets the window mask to a style that most likely matches -// app/resources/window_* -void GetDefaultWindowMask(const gfx::Size& size, gfx::Path* window_mask); - -} // namespace views - -#endif // #ifndef VIEWS_WINDOW_WINDOW_SHAPE_H_ |