summaryrefslogtreecommitdiffstats
path: root/chromium/ui/views/window/custom_frame_view.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/views/window/custom_frame_view.h')
-rw-r--r--chromium/ui/views/window/custom_frame_view.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/chromium/ui/views/window/custom_frame_view.h b/chromium/ui/views/window/custom_frame_view.h
index 8c96df7fc9f..fe5a3e4c7bd 100644
--- a/chromium/ui/views/window/custom_frame_view.h
+++ b/chromium/ui/views/window/custom_frame_view.h
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "ui/views/controls/button/button.h"
+#include "ui/views/window/frame_buttons.h"
#include "ui/views/window/non_client_view.h"
namespace gfx {
@@ -29,8 +30,8 @@ class Widget;
// rendering the non-standard window caption, border, and controls.
//
////////////////////////////////////////////////////////////////////////////////
-class CustomFrameView : public NonClientFrameView,
- public ButtonListener {
+class VIEWS_EXPORT CustomFrameView : public NonClientFrameView,
+ public ButtonListener {
public:
CustomFrameView();
virtual ~CustomFrameView();
@@ -51,14 +52,16 @@ class CustomFrameView : public NonClientFrameView,
// Overridden from View:
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() OVERRIDE;
- virtual gfx::Size GetMinimumSize() OVERRIDE;
- virtual gfx::Size GetMaximumSize() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual gfx::Size GetMaximumSize() const OVERRIDE;
// Overridden from ButtonListener:
virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
private:
+ friend class CustomFrameViewTest;
+
// Returns the thickness of the border that makes up the window frame edges.
// This does not include any client edge.
int FrameBorderThickness() const;
@@ -86,6 +89,10 @@ class CustomFrameView : public NonClientFrameView,
// there was one).
gfx::Rect IconBounds() const;
+ // Returns true if the title bar, caption buttons, and frame border should be
+ // drawn. If false, the client view occupies the full area of this view.
+ bool ShouldShowTitleBarAndBorder() const;
+
// Returns true if the client edge should be drawn. This is true if
// the window is not maximized.
bool ShouldShowClientEdge() const;
@@ -100,8 +107,13 @@ class CustomFrameView : public NonClientFrameView,
SkColor GetFrameColor() const;
const gfx::ImageSkia* GetFrameImage() const;
- // Layout various sub-components of this view.
+ // Performs the layout for the window control buttons based on the
+ // configuration specified in WindowButtonOrderProvider. The sizing and
+ // positions of the buttons affects LayoutTitleBar, call this beforehand.
void LayoutWindowControls();
+
+ // Calculations depend on the positions of the window controls. Always call
+ // LayoutWindowControls beforehand.
void LayoutTitleBar();
void LayoutClientView();
@@ -112,6 +124,10 @@ class CustomFrameView : public NonClientFrameView,
int hot_image_id,
int pushed_image_id);
+ // Returns the window caption button for the given FrameButton type, if it
+ // should be visible. Otherwise NULL.
+ ImageButton* GetImageButton(views::FrameButton button);
+
// The bounds of the client view, in this view's coordinates.
gfx::Rect client_view_bounds_;
@@ -136,6 +152,11 @@ class CustomFrameView : public NonClientFrameView,
// Background painter for the window frame.
scoped_ptr<FrameBackground> frame_background_;
+ // The horizontal boundaries for the title bar to layout within. Restricted
+ // by the space used by the leading and trailing buttons.
+ int minimum_title_bar_x_;
+ int maximum_title_bar_x_;
+
DISALLOW_COPY_AND_ASSIGN(CustomFrameView);
};