| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return views::Painter::CreateSolidFocusPainter( | 280 return views::Painter::CreateSolidFocusPainter( |
| 281 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()); | 281 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) { | 284 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) { |
| 285 view->set_id(VIEW_ID_STICKY_HEADER); | 285 view->set_id(VIEW_ID_STICKY_HEADER); |
| 286 view->set_background( | 286 view->set_background( |
| 287 views::Background::CreateSolidBackground(kBackgroundColor)); | 287 views::Background::CreateSolidBackground(kBackgroundColor)); |
| 288 view->SetBorder( | 288 view->SetBorder( |
| 289 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0))); | 289 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0))); |
| 290 view->SetPaintToLayer(true); |
| 291 view->layer()->SetFillsBoundsOpaquely(false); |
| 290 } | 292 } |
| 291 | 293 |
| 292 void TrayPopupUtils::ConfigureContainer(TriView::Container container, | 294 void TrayPopupUtils::ConfigureContainer(TriView::Container container, |
| 293 views::View* container_view) { | 295 views::View* container_view) { |
| 294 container_view->SetLayoutManager( | 296 container_view->SetLayoutManager( |
| 295 CreateDefaultLayoutManager(container).release()); | 297 CreateDefaultLayoutManager(container).release()); |
| 296 } | 298 } |
| 297 | 299 |
| 298 views::LabelButton* TrayPopupUtils::CreateTrayPopupBorderlessButton( | 300 views::LabelButton* TrayPopupUtils::CreateTrayPopupBorderlessButton( |
| 299 views::ButtonListener* listener, | 301 views::ButtonListener* listener, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { | 455 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { |
| 454 // TODO(tdanderson): Consider moving this into WmShell, or introduce a | 456 // TODO(tdanderson): Consider moving this into WmShell, or introduce a |
| 455 // CanShowSettings() method in each delegate type that has a | 457 // CanShowSettings() method in each delegate type that has a |
| 456 // ShowSettings() method. | 458 // ShowSettings() method. |
| 457 return status != LoginStatus::NOT_LOGGED_IN && | 459 return status != LoginStatus::NOT_LOGGED_IN && |
| 458 status != LoginStatus::LOCKED && | 460 status != LoginStatus::LOCKED && |
| 459 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 461 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
| 460 } | 462 } |
| 461 | 463 |
| 462 } // namespace ash | 464 } // namespace ash |
| OLD | NEW |