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

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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 11 months 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return views::Painter::CreateSolidFocusPainter( 279 return views::Painter::CreateSolidFocusPainter(
280 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()); 280 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF());
281 } 281 }
282 282
283 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) { 283 void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) {
284 view->set_id(VIEW_ID_STICKY_HEADER); 284 view->set_id(VIEW_ID_STICKY_HEADER);
285 view->set_background( 285 view->set_background(
286 views::Background::CreateSolidBackground(kBackgroundColor)); 286 views::Background::CreateSolidBackground(kBackgroundColor));
287 view->SetBorder( 287 view->SetBorder(
288 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0))); 288 views::CreateEmptyBorder(gfx::Insets(kMenuSeparatorVerticalPadding, 0)));
289 view->SetPaintToLayer(true); 289 view->SetPaintToLayer();
290 view->layer()->SetFillsBoundsOpaquely(false); 290 view->layer()->SetFillsBoundsOpaquely(false);
291 } 291 }
292 292
293 void TrayPopupUtils::ShowStickyHeaderSeparator(views::View* view, 293 void TrayPopupUtils::ShowStickyHeaderSeparator(views::View* view,
294 bool show_separator) { 294 bool show_separator) {
295 if (show_separator) { 295 if (show_separator) {
296 view->SetBorder(views::CreatePaddedBorder( 296 view->SetBorder(views::CreatePaddedBorder(
297 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, 297 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0,
298 kHorizontalSeparatorColor), 298 kHorizontalSeparatorColor),
299 gfx::Insets(kMenuSeparatorVerticalPadding, 0, 299 gfx::Insets(kMenuSeparatorVerticalPadding, 0,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) { 469 bool TrayPopupUtils::CanOpenWebUISettings(LoginStatus status) {
470 // TODO(tdanderson): Consider moving this into WmShell, or introduce a 470 // TODO(tdanderson): Consider moving this into WmShell, or introduce a
471 // CanShowSettings() method in each delegate type that has a 471 // CanShowSettings() method in each delegate type that has a
472 // ShowSettings() method. 472 // ShowSettings() method.
473 return status != LoginStatus::NOT_LOGGED_IN && 473 return status != LoginStatus::NOT_LOGGED_IN &&
474 status != LoginStatus::LOCKED && 474 status != LoginStatus::LOCKED &&
475 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); 475 !WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen();
476 } 476 }
477 477
478 } // namespace ash 478 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698