| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 toggle->SetAccessibleName(l10n_util::GetStringUTF16(accessible_name_id)); | 283 toggle->SetAccessibleName(l10n_util::GetStringUTF16(accessible_name_id)); |
| 284 return toggle; | 284 return toggle; |
| 285 } | 285 } |
| 286 | 286 |
| 287 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) { | 287 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) { |
| 288 view->set_id(VIEW_ID_STICKY_HEADER); | 288 view->set_id(VIEW_ID_STICKY_HEADER); |
| 289 view->set_background( | 289 view->set_background( |
| 290 views::Background::CreateSolidBackground(kBackgroundColor)); | 290 views::Background::CreateSolidBackground(kBackgroundColor)); |
| 291 view->SetBorder( | 291 view->SetBorder( |
| 292 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0))); | 292 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0))); |
| 293 view->SetPaintToLayer(true); |
| 294 view->layer()->SetFillsBoundsOpaquely(false); |
| 295 } |
| 296 |
| 297 void TrayPopupUtils::ShowStickyHeaderSeparator(views::View* view, |
| 298 bool show_separator) { |
| 299 if (show_separator) { |
| 300 view->SetBorder(views::CreatePaddedBorder( |
| 301 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, |
| 302 kHorizontalSeparatorColor), |
| 303 gfx::Insets(kMenuSeparatorVerticalPadding, 0, |
| 304 kMenuSeparatorVerticalPadding - kSeparatorWidth, 0))); |
| 305 } else { |
| 306 view->SetBorder(views::CreateEmptyBorder( |
| 307 gfx::Insets(kMenuSeparatorVerticalPadding, 0))); |
| 308 } |
| 309 view->SchedulePaint(); |
| 293 } | 310 } |
| 294 | 311 |
| 295 void TrayPopupUtils::ConfigureContainer(TriView::Container container, | 312 void TrayPopupUtils::ConfigureContainer(TriView::Container container, |
| 296 views::View* container_view) { | 313 views::View* container_view) { |
| 297 container_view->SetLayoutManager( | 314 container_view->SetLayoutManager( |
| 298 CreateDefaultLayoutManager(container).release()); | 315 CreateDefaultLayoutManager(container).release()); |
| 299 } | 316 } |
| 300 | 317 |
| 301 views::LabelButton* TrayPopupUtils::CreateTrayPopupBorderlessButton( | 318 views::LabelButton* TrayPopupUtils::CreateTrayPopupBorderlessButton( |
| 302 views::ButtonListener* listener, | 319 views::ButtonListener* listener, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { | 473 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { |
| 457 // TODO(tdanderson): Consider moving this into WmShell, or introduce a | 474 // TODO(tdanderson): Consider moving this into WmShell, or introduce a |
| 458 // CanShowSettings() method in each delegate type that has a | 475 // CanShowSettings() method in each delegate type that has a |
| 459 // ShowSettings() method. | 476 // ShowSettings() method. |
| 460 return status != LoginStatus::NOT_LOGGED_IN && | 477 return status != LoginStatus::NOT_LOGGED_IN && |
| 461 status != LoginStatus::LOCKED && | 478 status != LoginStatus::LOCKED && |
| 462 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 479 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
| 463 } | 480 } |
| 464 | 481 |
| 465 } // namespace ash | 482 } // namespace ash |
| OLD | NEW |