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

Side by Side Diff: chrome/browser/ui/views/toolbar/wrench_toolbar_button.cc

Issue 237963002: linux_aura: Remove the 'a' badge. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix official build. Created 6 years, 8 months 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 | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/common/chrome_version_info_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/toolbar/wrench_toolbar_button.h" 5 #include "chrome/browser/ui/views/toolbar/wrench_toolbar_button.h"
6 6
7 #include "grit/theme_resources.h" 7 #include "grit/theme_resources.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/base/theme_provider.h" 9 #include "ui/base/theme_provider.h"
10 10
11 WrenchToolbarButton::WrenchToolbarButton(views::MenuButtonListener* listener) 11 WrenchToolbarButton::WrenchToolbarButton(views::MenuButtonListener* listener)
12 : views::MenuButton(NULL, base::string16(), listener, false) { 12 : views::MenuButton(NULL, base::string16(), listener, false) {
13 wrench_icon_painter_.reset(new WrenchIconPainter(this)); 13 wrench_icon_painter_.reset(new WrenchIconPainter(this));
14 14
15 // Used for sizing only. 15 // Used for sizing only.
16 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 16 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance();
17 SetIcon(*rb.GetImageSkiaNamed(IDR_TOOLBAR_BEZEL_HOVER)); 17 SetIcon(*rb.GetImageSkiaNamed(IDR_TOOLBAR_BEZEL_HOVER));
18 } 18 }
19 19
20 WrenchToolbarButton::~WrenchToolbarButton() { 20 WrenchToolbarButton::~WrenchToolbarButton() {
21 } 21 }
22 22
23 void WrenchToolbarButton::SetSeverity(WrenchIconPainter::Severity severity, 23 void WrenchToolbarButton::SetSeverity(WrenchIconPainter::Severity severity,
24 bool animate) { 24 bool animate) {
25 wrench_icon_painter_->SetSeverity(severity, animate); 25 wrench_icon_painter_->SetSeverity(severity, animate);
26 } 26 }
27 27
28 void WrenchToolbarButton::OnPaint(gfx::Canvas* canvas) { 28 void WrenchToolbarButton::OnPaint(gfx::Canvas* canvas) {
29 // Badge linux aura builds so they're quickly identifiable.
30 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
31 wrench_icon_painter_->set_badge(
32 *GetThemeProvider()->GetImageSkiaNamed(IDR_TOOLS_BADGE_AURA));
33 #endif
34
35 wrench_icon_painter_->Paint( 29 wrench_icon_painter_->Paint(
36 canvas, GetThemeProvider(), gfx::Rect(size()), GetCurrentBezelType()); 30 canvas, GetThemeProvider(), gfx::Rect(size()), GetCurrentBezelType());
37 views::Painter::PaintFocusPainter(this, canvas, focus_painter()); 31 views::Painter::PaintFocusPainter(this, canvas, focus_painter());
38 } 32 }
39 33
40 void WrenchToolbarButton::ScheduleWrenchIconPaint() { 34 void WrenchToolbarButton::ScheduleWrenchIconPaint() {
41 SchedulePaint(); 35 SchedulePaint();
42 } 36 }
43 37
44 WrenchIconPainter::BezelType WrenchToolbarButton::GetCurrentBezelType() const { 38 WrenchIconPainter::BezelType WrenchToolbarButton::GetCurrentBezelType() const {
45 switch (state()) { 39 switch (state()) {
46 case STATE_HOVERED: 40 case STATE_HOVERED:
47 return WrenchIconPainter::BEZEL_HOVER; 41 return WrenchIconPainter::BEZEL_HOVER;
48 case STATE_PRESSED: 42 case STATE_PRESSED:
49 return WrenchIconPainter::BEZEL_PRESSED; 43 return WrenchIconPainter::BEZEL_PRESSED;
50 default: 44 default:
51 return WrenchIconPainter::BEZEL_NONE; 45 return WrenchIconPainter::BEZEL_NONE;
52 } 46 }
53 } 47 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/common/chrome_version_info_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698