Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Side by Side Diff: chrome/browser/ui/views/toolbar/back_button.h

Issue 62873007: [Toolbar] Base toolbar button class with background images for button states (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: overriding Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/toolbar/back_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_BUTTON_H_
7
8 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
9
10 namespace ui {
11 class MenuModel;
12 }
13
14 namespace views {
15 class ButtonListener;
16 }
17
18 // A subclass of ToolbarButton to allow the back button's hittest region to
19 // extend all the way to the start of the toolbar (i.e. the screen edge) in
20 // maximized mode, to benefit from Fitt's Law. The button images and focus
21 // border are still drawn with the normal square shape.
22 class BackButton : public ToolbarButton {
23 public:
24 // Takes ownership of the |model|, which can be null if no menu
25 // is to be shown.
26 BackButton(views::ButtonListener* listener, ui::MenuModel* model);
27 virtual ~BackButton();
28
29 void SetLeadingMargin(int margin);
30
31 protected:
32 virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
33
34 private:
35 // Any leading margin to be applied. Used when the back button is in
36 // a maximized state to extend to the full window width.
37 int margin_leading_;
38
39 DISALLOW_COPY_AND_ASSIGN(BackButton);
40 };
41
42 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_BUTTON_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/toolbar/back_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698