| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 canvas->DrawImageInt(*image, | 161 canvas->DrawImageInt(*image, |
| 162 bounds.x() + ((bounds.width() - image->width()) / 2), | 162 bounds.x() + ((bounds.width() - image->width()) / 2), |
| 163 bounds.y() + ((bounds.height() - image->height()) / 2)); | 163 bounds.y() + ((bounds.height() - image->height()) / 2)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 int OverflowButton::NonMaterialBackgroundImageId() const { | 166 int OverflowButton::NonMaterialBackgroundImageId() const { |
| 167 if (shelf_view_->IsShowingOverflowBubble()) | 167 if (shelf_view_->IsShowingOverflowBubble()) |
| 168 return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; | 168 return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; |
| 169 else if (wm_shelf_->IsDimmed()) | |
| 170 return IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK; | |
| 171 return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; | 169 return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; |
| 172 } | 170 } |
| 173 | 171 |
| 174 gfx::Rect OverflowButton::CalculateButtonBounds() const { | 172 gfx::Rect OverflowButton::CalculateButtonBounds() const { |
| 175 ShelfAlignment alignment = wm_shelf_->GetAlignment(); | 173 ShelfAlignment alignment = wm_shelf_->GetAlignment(); |
| 176 gfx::Rect bounds(GetContentsBounds()); | 174 gfx::Rect bounds(GetContentsBounds()); |
| 177 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 175 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 178 if (MaterialDesignController::IsShelfMaterial()) { | 176 if (MaterialDesignController::IsShelfMaterial()) { |
| 179 const int width_offset = (bounds.width() - kOverflowButtonSize) / 2; | 177 const int width_offset = (bounds.width() - kOverflowButtonSize) / 2; |
| 180 const int height_offset = (bounds.height() - kOverflowButtonSize) / 2; | 178 const int height_offset = (bounds.height() - kOverflowButtonSize) / 2; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 202 bounds = | 200 bounds = |
| 203 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2, | 201 gfx::Rect(bounds.x() + (bounds.width() - background->width()) / 2, |
| 204 bounds.y() + kShelfItemInset, background->width(), | 202 bounds.y() + kShelfItemInset, background->width(), |
| 205 background->height()); | 203 background->height()); |
| 206 } | 204 } |
| 207 } | 205 } |
| 208 return bounds; | 206 return bounds; |
| 209 } | 207 } |
| 210 | 208 |
| 211 } // namespace ash | 209 } // namespace ash |
| OLD | NEW |