| 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.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 const int kBackgroundOffset = (48 - kButtonHoverSize) / 2; | 34 const int kBackgroundOffset = (48 - kButtonHoverSize) / 2; |
| 35 | 35 |
| 36 } // namesapce | 36 } // namesapce |
| 37 | 37 |
| 38 OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf) | 38 OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf) |
| 39 : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) { | 39 : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) { |
| 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 | 42 |
| 43 SetAccessibilityFocusable(true); | 43 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 44 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME)); | 44 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 OverflowButton::~OverflowButton() {} | 47 OverflowButton::~OverflowButton() {} |
| 48 | 48 |
| 49 void OverflowButton::OnShelfAlignmentChanged() { | 49 void OverflowButton::OnShelfAlignmentChanged() { |
| 50 SchedulePaint(); | 50 SchedulePaint(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void OverflowButton::PaintBackground(gfx::Canvas* canvas, int alpha) { | 53 void OverflowButton::PaintBackground(gfx::Canvas* canvas, int alpha) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 image = bottom_image_; | 136 image = bottom_image_; |
| 137 break; | 137 break; |
| 138 } | 138 } |
| 139 | 139 |
| 140 canvas->DrawImageInt(*image, | 140 canvas->DrawImageInt(*image, |
| 141 bounds.x() + ((bounds.width() - image->width()) / 2), | 141 bounds.x() + ((bounds.width() - image->width()) / 2), |
| 142 bounds.y() + ((bounds.height() - image->height()) / 2)); | 142 bounds.y() + ((bounds.height() - image->height()) / 2)); |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace ash | 145 } // namespace ash |
| OLD | NEW |