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

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: Add back button subclass 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
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 #include "ui/views/controls/button/button.h"
Peter Kasting 2013/11/26 22:24:31 Nit: Is this #include necessary? Seems like we co
Greg Billock 2013/11/27 14:22:35 Done.
10
11 namespace ui {
12 class MenuModel;
13 }
14
15 // Modifies the ToolbarButton behavior by allowing the back button
16 // to extend to the full margin if the toolbar is in a maximized state,
17 // while keeping the usual margin between the drawn button and the edge
18 // of the toolbar. This is done by adjusting the theme paint rect used
19 // in the underlying button, and similarly adjusting the focus border.
Peter Kasting 2013/11/26 22:24:31 Nit: This comment might be clearer: A subclass of
Greg Billock 2013/11/27 14:22:35 Sounds good.
20 class BackButton : public ToolbarButton {
21 public:
22 // Takes ownership of the |model|, which can be null if no menu
23 // is to be shown.
24 BackButton(views::ButtonListener* listener, ui::MenuModel* model);
25 virtual ~BackButton();
26
27 void SetLeftMargin(int margin);
Peter Kasting 2013/11/26 22:24:31 Nit: Consider using "start" or "leading" in place
Greg Billock 2013/11/27 14:22:35 Done.
28
29 protected:
30 virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
31
32 private:
33 // Any leading margin to be applied. Used when the back button is in
34 // a maximized state to extend to the full window width.
35 int margin_left_;
36
37 DISALLOW_COPY_AND_ASSIGN(BackButton);
38 };
39
40 #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') | chrome/browser/ui/views/toolbar/back_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698