Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/system/tray/tray_popup_utils.h" | 5 #include "ash/common/system/tray/tray_popup_utils.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.h" |
| 8 #include "ash/common/ash_view_ids.h" | 8 #include "ash/common/ash_view_ids.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 | 322 |
| 323 return std::move(ink_drop); | 323 return std::move(ink_drop); |
| 324 } | 324 } |
| 325 | 325 |
| 326 std::unique_ptr<views::InkDropRipple> TrayPopupUtils::CreateInkDropRipple( | 326 std::unique_ptr<views::InkDropRipple> TrayPopupUtils::CreateInkDropRipple( |
| 327 TrayPopupInkDropStyle ink_drop_style, | 327 TrayPopupInkDropStyle ink_drop_style, |
| 328 const views::View* host, | 328 const views::View* host, |
| 329 const gfx::Point& center_point) { | 329 const gfx::Point& center_point) { |
| 330 const gfx::Rect bounds = | 330 const gfx::Rect bounds = |
| 331 TrayPopupUtils::GetInkDropBounds(ink_drop_style, host); | 331 TrayPopupUtils::GetInkDropBounds(ink_drop_style, host); |
| 332 const gfx::Insets insets = TrayPopupUtils::GetInkDropInsets(ink_drop_style); | |
|
bruthig
2016/11/28 22:13:45
nit: Can you tighten the scope for |insets|. i.e.
mohsen
2016/11/29 00:07:12
Done.
| |
| 332 switch (ink_drop_style) { | 333 switch (ink_drop_style) { |
| 333 case TrayPopupInkDropStyle::HOST_CENTERED: | 334 case TrayPopupInkDropStyle::HOST_CENTERED: |
| 334 if (MaterialDesignController::GetMode() == | 335 if (MaterialDesignController::GetMode() == |
| 335 MaterialDesignController::MATERIAL_EXPERIMENTAL) { | 336 MaterialDesignController::MATERIAL_EXPERIMENTAL) { |
| 336 return base::MakeUnique<views::SquareInkDropRipple>( | 337 return base::MakeUnique<views::SquareInkDropRipple>( |
| 337 bounds.size(), bounds.size().width() / 2, bounds.size(), | 338 bounds.size(), bounds.size().width() / 2, bounds.size(), |
| 338 bounds.size().width() / 2, center_point, bounds.CenterPoint(), | 339 bounds.size().width() / 2, center_point, bounds.CenterPoint(), |
| 339 kTrayPopupInkDropBaseColor, kTrayPopupInkDropRippleOpacity); | 340 kTrayPopupInkDropBaseColor, kTrayPopupInkDropRippleOpacity); |
| 340 } | 341 } |
| 341 // Intentional fall through. | 342 // Intentional fall through. |
| 342 case TrayPopupInkDropStyle::INSET_BOUNDS: | 343 case TrayPopupInkDropStyle::INSET_BOUNDS: |
| 343 case TrayPopupInkDropStyle::FILL_BOUNDS: | 344 case TrayPopupInkDropStyle::FILL_BOUNDS: |
| 344 return base::MakeUnique<views::FloodFillInkDropRipple>( | 345 return base::MakeUnique<views::FloodFillInkDropRipple>( |
| 345 bounds, center_point, kTrayPopupInkDropBaseColor, | 346 host->size(), insets, center_point, kTrayPopupInkDropBaseColor, |
| 346 kTrayPopupInkDropRippleOpacity); | 347 kTrayPopupInkDropRippleOpacity); |
| 347 } | 348 } |
| 348 // Required for some compilers. | 349 // Required for some compilers. |
| 349 NOTREACHED(); | 350 NOTREACHED(); |
| 350 return nullptr; | 351 return nullptr; |
| 351 } | 352 } |
| 352 | 353 |
| 353 std::unique_ptr<views::InkDropHighlight> TrayPopupUtils::CreateInkDropHighlight( | 354 std::unique_ptr<views::InkDropHighlight> TrayPopupUtils::CreateInkDropHighlight( |
| 354 TrayPopupInkDropStyle ink_drop_style, | 355 TrayPopupInkDropStyle ink_drop_style, |
| 355 const views::View* host) { | 356 const views::View* host) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { | 431 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { |
| 431 // TODO(tdanderson): Consider moving this into WmShell, or introduce a | 432 // TODO(tdanderson): Consider moving this into WmShell, or introduce a |
| 432 // CanShowSettings() method in each delegate type that has a | 433 // CanShowSettings() method in each delegate type that has a |
| 433 // ShowSettings() method. | 434 // ShowSettings() method. |
| 434 return status != LoginStatus::NOT_LOGGED_IN && | 435 return status != LoginStatus::NOT_LOGGED_IN && |
| 435 status != LoginStatus::LOCKED && | 436 status != LoginStatus::LOCKED && |
| 436 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 437 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
| 437 } | 438 } |
| 438 | 439 |
| 439 } // namespace ash | 440 } // namespace ash |
| OLD | NEW |