1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_BUTTON_H_
8 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
19 // A subclass of ToolbarButton to allow the back button's hittest region to
20 // extend all the way to the start of the toolbar (i.e. the screen edge) in
21 // maximized mode, to benefit from Fitt's Law. The button images and focus
22 // border are still drawn with the normal square shape.
23 class BackButton
: public ToolbarButton
{
25 // Takes ownership of the |model|, which can be null if no menu
27 BackButton(views::ButtonListener
* listener
, ui::MenuModel
* model
);
28 ~BackButton() override
;
30 void SetLeadingMargin(int margin
);
34 const char* GetClassName() const override
;
35 scoped_ptr
<views::LabelButtonBorder
> CreateDefaultBorder() const override
;
36 gfx::Rect
GetThemePaintRect() const override
;
38 // Any leading margin to be applied. Used when the back button is in
39 // a maximized state to extend to the full window width.
42 DISALLOW_COPY_AND_ASSIGN(BackButton
);
45 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_BUTTON_H_