| 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/common/shelf/overflow_button.h" | 5 #include "ash/common/shelf/overflow_button.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/shelf/ink_drop_button_listener.h" | 9 #include "ash/common/shelf/ink_drop_button_listener.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 canvas->DrawImageInt(*image, | 123 canvas->DrawImageInt(*image, |
| 124 bounds.x() + ((bounds.width() - image->width()) / 2), | 124 bounds.x() + ((bounds.width() - image->width()) / 2), |
| 125 bounds.y() + ((bounds.height() - image->height()) / 2)); | 125 bounds.y() + ((bounds.height() - image->height()) / 2)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 int OverflowButton::NonMaterialBackgroundImageId() { | 128 int OverflowButton::NonMaterialBackgroundImageId() { |
| 129 if (wm_shelf_->IsShowingOverflowBubble()) | 129 if (wm_shelf_->IsShowingOverflowBubble()) |
| 130 return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; | 130 return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; |
| 131 else if (wm_shelf_->IsDimmed()) | 131 else if (wm_shelf_->GetBackgroundType() == SHELF_BACKGROUND_MAXIMIZED) |
| 132 return IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK; | 132 return IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK; |
| 133 return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; | 133 return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; |
| 134 } | 134 } |
| 135 | 135 |
| 136 gfx::Rect OverflowButton::CalculateButtonBounds() { | 136 gfx::Rect OverflowButton::CalculateButtonBounds() { |
| 137 ShelfAlignment alignment = wm_shelf_->GetAlignment(); | 137 ShelfAlignment alignment = wm_shelf_->GetAlignment(); |
| 138 gfx::Rect bounds(GetContentsBounds()); | 138 gfx::Rect bounds(GetContentsBounds()); |
| 139 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 139 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 140 if (MaterialDesignController::IsShelfMaterial()) { | 140 if (MaterialDesignController::IsShelfMaterial()) { |
| 141 const int width_offset = (bounds.width() - kOverflowButtonSize) / 2; | 141 const int width_offset = (bounds.width() - kOverflowButtonSize) / 2; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 164 bounds = | 164 bounds = |
| 165 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2, | 165 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2, |
| 166 bounds.y() + kShelfItemInset, background->width(), | 166 bounds.y() + kShelfItemInset, background->width(), |
| 167 background->height()); | 167 background->height()); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 return bounds; | 170 return bounds; |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace ash | 173 } // namespace ash |
| OLD | NEW |