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

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

Issue 75873002: [SiteChip] Add the basic painting of the site chip button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use constants 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 (c) 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_SITE_CHIP_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_
7
8 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
9 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
10 #include "ui/views/controls/button/button.h"
11
12 class ToolbarView;
13
14 namespace content {
15 class WebContents;
16 }
17
18 namespace gfx {
19 class Canvas;
20 }
21
22 namespace views {
23 class Button;
24 class Label;
25 }
26
27 class SiteChipView : public ToolbarButton,
28 public views::ButtonListener {
29 public:
30 explicit SiteChipView(ToolbarView* toolbar_view);
31 virtual ~SiteChipView();
32
33 void Init();
34
35 bool ShouldShow();
Peter Kasting 2013/12/03 00:58:10 Nit: Comment?
Greg Billock 2013/12/03 17:35:08 Done.
36
37 void Update(content::WebContents* tab);
38
39 views::ImageView* location_icon_view() { return location_icon_view_; }
40
41 // ToolbarButton:
42 virtual gfx::Size GetPreferredSize() OVERRIDE;
43 virtual void Layout() OVERRIDE;
44 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
45
46 // views::ButtonListener:
47 void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE;
48
49 // Return true if we will draw an opaque background
Peter Kasting 2013/12/03 00:58:10 Nit: Return -> Returns; wrap as close to 80 cols a
Greg Billock 2013/12/03 17:35:08 Not using this any more. Deleting.
50 // (i.e. for EV cert or malware state)
51 bool DrawingBackground();
Peter Kasting 2013/12/03 00:58:10 Nit: Place all non-virtuals in a group
Greg Billock 2013/12/03 17:35:08 deleted
52
53 private:
54 static const int kEdgeThickness;
55 static const int kIconTextSpacing;
56 static const int kTrailingLabelMargin;
Peter Kasting 2013/12/03 00:58:10 Nit: I suggest a blank line below here Really tho
Greg Billock 2013/12/03 17:35:08 Done.
57 ToolbarView* toolbar_view_;
58 views::Label* host_label_;
59 LocationIconView* location_icon_view_;
60
61 DISALLOW_COPY_AND_ASSIGN(SiteChipView);
62 };
63
64 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698