| 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 "ash/shelf/overflow_button.h" | 5 #include "ash/shelf/overflow_button.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
| 10 #include "grit/ash_resources.h" | 10 #include "grit/ash_resources.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 const int kButtonHoverSize = 28; | 31 const int kButtonHoverSize = 28; |
| 32 | 32 |
| 33 const int kBackgroundOffset = (48 - kButtonHoverSize) / 2; | 33 const int kBackgroundOffset = (48 - kButtonHoverSize) / 2; |
| 34 | 34 |
| 35 } // namesapce | 35 } // namesapce |
| 36 | 36 |
| 37 OverflowButton::OverflowButton(views::ButtonListener* listener) | 37 OverflowButton::OverflowButton(views::ButtonListener* listener) |
| 38 : CustomButton(listener), | 38 : CustomButton(listener), |
| 39 bottom_image_(NULL) { | 39 bottom_image_(NULL) { |
| 40 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 40 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 41 bottom_image_ = rb.GetImageNamed(IDR_ASH_SHELF_OVERFLOW).ToImageSkia(); | 41 bottom_image_ = rb->GetImageNamed(IDR_ASH_SHELF_OVERFLOW).ToImageSkia(); |
| 42 | |
| 43 | 42 |
| 44 SetAccessibilityFocusable(true); | 43 SetAccessibilityFocusable(true); |
| 45 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME)); | 44 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME)); |
| 46 } | 45 } |
| 47 | 46 |
| 48 OverflowButton::~OverflowButton() {} | 47 OverflowButton::~OverflowButton() {} |
| 49 | 48 |
| 50 void OverflowButton::OnShelfAlignmentChanged() { | 49 void OverflowButton::OnShelfAlignmentChanged() { |
| 51 SchedulePaint(); | 50 SchedulePaint(); |
| 52 } | 51 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 image = bottom_image_; | 141 image = bottom_image_; |
| 143 break; | 142 break; |
| 144 } | 143 } |
| 145 | 144 |
| 146 canvas->DrawImageInt(*image, | 145 canvas->DrawImageInt(*image, |
| 147 bounds.x() + ((bounds.width() - image->width()) / 2), | 146 bounds.x() + ((bounds.width() - image->width()) / 2), |
| 148 bounds.y() + ((bounds.height() - image->height()) / 2)); | 147 bounds.y() + ((bounds.height() - image->height()) / 2)); |
| 149 } | 148 } |
| 150 | 149 |
| 151 } // namespace ash | 150 } // namespace ash |
| OLD | NEW |