Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: ash/common/system/tray/tray_popup_utils.cc

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: Addressed review comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 case TrayPopupInkDropStyle::HOST_CENTERED: 334 case TrayPopupInkDropStyle::HOST_CENTERED:
335 if (MaterialDesignController::GetMode() == 335 if (MaterialDesignController::GetMode() ==
336 MaterialDesignController::MATERIAL_EXPERIMENTAL) { 336 MaterialDesignController::MATERIAL_EXPERIMENTAL) {
337 return base::MakeUnique<views::SquareInkDropRipple>( 337 return base::MakeUnique<views::SquareInkDropRipple>(
338 bounds.size(), bounds.size().width() / 2, bounds.size(), 338 bounds.size(), bounds.size().width() / 2, bounds.size(),
339 bounds.size().width() / 2, center_point, bounds.CenterPoint(), 339 bounds.size().width() / 2, center_point, bounds.CenterPoint(),
340 color, kTrayPopupInkDropRippleOpacity); 340 color, kTrayPopupInkDropRippleOpacity);
341 } 341 }
342 // Intentional fall through. 342 // Intentional fall through.
343 case TrayPopupInkDropStyle::INSET_BOUNDS: 343 case TrayPopupInkDropStyle::INSET_BOUNDS:
344 case TrayPopupInkDropStyle::FILL_BOUNDS: 344 case TrayPopupInkDropStyle::FILL_BOUNDS: {
345 const gfx::Insets insets =
346 TrayPopupUtils::GetInkDropInsets(ink_drop_style);
345 return base::MakeUnique<views::FloodFillInkDropRipple>( 347 return base::MakeUnique<views::FloodFillInkDropRipple>(
346 bounds, center_point, color, kTrayPopupInkDropRippleOpacity); 348 host->size(), insets, center_point, color,
349 kTrayPopupInkDropRippleOpacity);
350 }
347 } 351 }
348 // Required for some compilers. 352 // Required for some compilers.
349 NOTREACHED(); 353 NOTREACHED();
350 return nullptr; 354 return nullptr;
351 } 355 }
352 356
353 std::unique_ptr<views::InkDropHighlight> TrayPopupUtils::CreateInkDropHighlight( 357 std::unique_ptr<views::InkDropHighlight> TrayPopupUtils::CreateInkDropHighlight(
354 TrayPopupInkDropStyle ink_drop_style, 358 TrayPopupInkDropStyle ink_drop_style,
355 const views::View* host, 359 const views::View* host,
356 SkColor color) { 360 SkColor color) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { 434 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) {
431 // TODO(tdanderson): Consider moving this into WmShell, or introduce a 435 // TODO(tdanderson): Consider moving this into WmShell, or introduce a
432 // CanShowSettings() method in each delegate type that has a 436 // CanShowSettings() method in each delegate type that has a
433 // ShowSettings() method. 437 // ShowSettings() method.
434 return status != LoginStatus::NOT_LOGGED_IN && 438 return status != LoginStatus::NOT_LOGGED_IN &&
435 status != LoginStatus::LOCKED && 439 status != LoginStatus::LOCKED &&
436 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); 440 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen();
437 } 441 }
438 442
439 } // namespace ash 443 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698