| 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" |
| 11 #include "ash/common/system/tray/fixed_sized_image_view.h" | 11 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 12 #include "ash/common/system/tray/size_range_layout.h" | 12 #include "ash/common/system/tray/size_range_layout.h" |
| 13 #include "ash/common/system/tray/tray_constants.h" | 13 #include "ash/common/system/tray/tray_constants.h" |
| 14 #include "ash/common/system/tray/tray_popup_item_style.h" | 14 #include "ash/common/system/tray/tray_popup_item_style.h" |
| 15 #include "ash/common/system/tray/tray_popup_label_button.h" | 15 #include "ash/common/system/tray/tray_popup_label_button.h" |
| 16 #include "ash/common/system/tray/tray_popup_label_button_border.h" | 16 #include "ash/common/system/tray/tray_popup_label_button_border.h" |
| 17 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
| 18 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 20 #include "ui/compositor/layer_type.h" |
| 20 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" | 21 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" |
| 21 #include "ui/views/animation/ink_drop_highlight.h" | 22 #include "ui/views/animation/ink_drop_highlight.h" |
| 22 #include "ui/views/animation/ink_drop_impl.h" | 23 #include "ui/views/animation/ink_drop_impl.h" |
| 23 #include "ui/views/animation/ink_drop_mask.h" | 24 #include "ui/views/animation/ink_drop_mask.h" |
| 24 #include "ui/views/animation/square_ink_drop_ripple.h" | 25 #include "ui/views/animation/square_ink_drop_ripple.h" |
| 25 #include "ui/views/background.h" | 26 #include "ui/views/background.h" |
| 26 #include "ui/views/border.h" | 27 #include "ui/views/border.h" |
| 27 #include "ui/views/controls/button/button.h" | 28 #include "ui/views/controls/button/button.h" |
| 28 #include "ui/views/controls/button/label_button.h" | 29 #include "ui/views/controls/button/label_button.h" |
| 29 #include "ui/views/controls/button/md_text_button.h" | 30 #include "ui/views/controls/button/md_text_button.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 return views::Painter::CreateSolidFocusPainter( | 280 return views::Painter::CreateSolidFocusPainter( |
| 280 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()); | 281 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()); |
| 281 } | 282 } |
| 282 | 283 |
| 283 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) { | 284 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) { |
| 284 view->set_id(VIEW_ID_STICKY_HEADER); | 285 view->set_id(VIEW_ID_STICKY_HEADER); |
| 285 view->set_background( | 286 view->set_background( |
| 286 views::Background::CreateSolidBackground(kBackgroundColor)); | 287 views::Background::CreateSolidBackground(kBackgroundColor)); |
| 287 view->SetBorder( | 288 view->SetBorder( |
| 288 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0))); | 289 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0))); |
| 289 view->SetPaintToLayer(true); | 290 view->SetPaintToLayer(ui::LAYER_TEXTURED); |
| 290 view->layer()->SetFillsBoundsOpaquely(false); | 291 view->layer()->SetFillsBoundsOpaquely(false); |
| 291 } | 292 } |
| 292 | 293 |
| 293 void TrayPopupUtils::ShowStickyHeaderSeparator(views::View* view, | 294 void TrayPopupUtils::ShowStickyHeaderSeparator(views::View* view, |
| 294 bool show_separator) { | 295 bool show_separator) { |
| 295 if (show_separator) { | 296 if (show_separator) { |
| 296 view->SetBorder(views::CreatePaddedBorder( | 297 view->SetBorder(views::CreatePaddedBorder( |
| 297 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, | 298 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, |
| 298 kHorizontalSeparatorColor), | 299 kHorizontalSeparatorColor), |
| 299 gfx::Insets(kMenuSeparatorVerticalPadding, 0, | 300 gfx::Insets(kMenuSeparatorVerticalPadding, 0, |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { | 470 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { |
| 470 // TODO(tdanderson): Consider moving this into WmShell, or introduce a | 471 // TODO(tdanderson): Consider moving this into WmShell, or introduce a |
| 471 // CanShowSettings() method in each delegate type that has a | 472 // CanShowSettings() method in each delegate type that has a |
| 472 // ShowSettings() method. | 473 // ShowSettings() method. |
| 473 return status != LoginStatus::NOT_LOGGED_IN && | 474 return status != LoginStatus::NOT_LOGGED_IN && |
| 474 status != LoginStatus::LOCKED && | 475 status != LoginStatus::LOCKED && |
| 475 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 476 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
| 476 } | 477 } |
| 477 | 478 |
| 478 } // namespace ash | 479 } // namespace ash |
| OLD | NEW |