| OLD | NEW |
| 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 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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. | 29 // Badge linux aura builds so they're quickly identifiable. |
| 30 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 30 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 31 wrench_icon_painter_->set_badge( | 31 wrench_icon_painter_->set_badge( |
| 32 *GetThemeProvider()->GetImageSkiaNamed(IDR_TOOLS_BADGE_AURA)); | 32 *GetThemeProvider()->GetImageSkiaNamed(IDR_TOOLS_BADGE_AURA)); |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 wrench_icon_painter_->Paint( | 35 wrench_icon_painter_->Paint( |
| 36 canvas, GetThemeProvider(), gfx::Rect(size()), GetCurrentBezelType()); | 36 canvas, GetThemeProvider(), gfx::Rect(size()), GetCurrentBezelType()); |
| 37 OnPaintFocusBorder(canvas); |
| 37 } | 38 } |
| 38 | 39 |
| 39 void WrenchToolbarButton::ScheduleWrenchIconPaint() { | 40 void WrenchToolbarButton::ScheduleWrenchIconPaint() { |
| 40 SchedulePaint(); | 41 SchedulePaint(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 WrenchIconPainter::BezelType WrenchToolbarButton::GetCurrentBezelType() const { | 44 WrenchIconPainter::BezelType WrenchToolbarButton::GetCurrentBezelType() const { |
| 44 switch (state()) { | 45 switch (state()) { |
| 45 case STATE_HOVERED: | 46 case STATE_HOVERED: |
| 46 return WrenchIconPainter::BEZEL_HOVER; | 47 return WrenchIconPainter::BEZEL_HOVER; |
| 47 case STATE_PRESSED: | 48 case STATE_PRESSED: |
| 48 return WrenchIconPainter::BEZEL_PRESSED; | 49 return WrenchIconPainter::BEZEL_PRESSED; |
| 49 default: | 50 default: |
| 50 return WrenchIconPainter::BEZEL_NONE; | 51 return WrenchIconPainter::BEZEL_NONE; |
| 51 } | 52 } |
| 52 } | 53 } |
| OLD | NEW |