| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 base::MakeUnique<views::FillLayout>()); | 214 base::MakeUnique<views::FillLayout>()); |
| 215 | 215 |
| 216 return tri_view; | 216 return tri_view; |
| 217 } | 217 } |
| 218 | 218 |
| 219 views::Label* TrayPopupUtils::CreateDefaultLabel() { | 219 views::Label* TrayPopupUtils::CreateDefaultLabel() { |
| 220 views::Label* label = new views::Label(); | 220 views::Label* label = new views::Label(); |
| 221 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 221 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 222 label->SetBorder( | 222 label->SetBorder( |
| 223 views::CreateEmptyBorder(0, 0, 0, kTrayPopupLabelRightPadding)); | 223 views::CreateEmptyBorder(0, 0, 0, kTrayPopupLabelRightPadding)); |
| 224 | 224 // Frequently the label will paint to a layer that's non-opaque, so subpixel |
| 225 // TODO(bruthig): Fix this so that |label| uses the kBackgroundColor to | 225 // rendering won't work unless we explicitly set a background. See |
| 226 // perform subpixel rendering instead of disabling subpixel rendering. | 226 // crbug.com/686363 |
| 227 // | 227 label->set_background( |
| 228 // Text rendered on a non-opaque background looks ugly and it is possible for | 228 views::Background::CreateSolidBackground(kBackgroundColor)); |
| 229 // labels to given a a clear canvas at paint time when an ink drop is visible. | 229 label->SetBackgroundColor(kBackgroundColor); |
| 230 // See http://crbug.com/661714. | |
| 231 label->SetSubpixelRenderingEnabled(false); | |
| 232 | |
| 233 return label; | 230 return label; |
| 234 } | 231 } |
| 235 | 232 |
| 236 views::ImageView* TrayPopupUtils::CreateMainImageView() { | 233 views::ImageView* TrayPopupUtils::CreateMainImageView() { |
| 237 return new FixedSizedImageView( | 234 return new FixedSizedImageView( |
| 238 GetTrayConstant(TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH), | 235 GetTrayConstant(TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH), |
| 239 GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT)); | 236 GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT)); |
| 240 } | 237 } |
| 241 | 238 |
| 242 views::ImageView* TrayPopupUtils::CreateMoreImageView() { | 239 views::ImageView* TrayPopupUtils::CreateMoreImageView() { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { | 466 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { |
| 470 // TODO(tdanderson): Consider moving this into WmShell, or introduce a | 467 // TODO(tdanderson): Consider moving this into WmShell, or introduce a |
| 471 // CanShowSettings() method in each delegate type that has a | 468 // CanShowSettings() method in each delegate type that has a |
| 472 // ShowSettings() method. | 469 // ShowSettings() method. |
| 473 return status != LoginStatus::NOT_LOGGED_IN && | 470 return status != LoginStatus::NOT_LOGGED_IN && |
| 474 status != LoginStatus::LOCKED && | 471 status != LoginStatus::LOCKED && |
| 475 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); | 472 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); |
| 476 } | 473 } |
| 477 | 474 |
| 478 } // namespace ash | 475 } // namespace ash |
| OLD | NEW |