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

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

Issue 2271763005: Fix system tray focus on locked state screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_background_view.h" 5 #include "ash/common/system/tray/tray_background_view.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/shelf/shelf_constants.h" 8 #include "ash/common/shelf/shelf_constants.h"
9 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
10 #include "ash/common/shelf/wm_shelf_util.h" 10 #include "ash/common/shelf/wm_shelf_util.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 SchedulePaint(); 531 SchedulePaint();
532 } 532 }
533 } 533 }
534 534
535 void TrayBackgroundView::SetSeparatorVisibility(bool is_shown) { 535 void TrayBackgroundView::SetSeparatorVisibility(bool is_shown) {
536 is_separator_visible_ = is_shown; 536 is_separator_visible_ = is_shown;
537 SchedulePaint(); 537 SchedulePaint();
538 } 538 }
539 539
540 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { 540 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) {
541 ActionableView::OnPaint(canvas);
541 if (!MaterialDesignController::IsShelfMaterial() || 542 if (!MaterialDesignController::IsShelfMaterial() ||
542 shelf()->GetBackgroundType() == 543 shelf()->GetBackgroundType() ==
543 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || 544 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT ||
544 !is_separator_visible_) { 545 !is_separator_visible_) {
545 return; 546 return;
546 } 547 }
547 // In the given |canvas|, draws a 1x32px separator line 4 pixel to the right 548 // In the given |canvas|, draws a 1x32px separator line 4 pixel to the right
548 // of the TrayBackgroundView. 549 // of the TrayBackgroundView.
549 const bool horizontal_shelf = IsHorizontalAlignment(shelf_alignment_); 550 const bool horizontal_shelf = IsHorizontalAlignment(shelf_alignment_);
550 const gfx::Rect local_bounds = GetLocalBounds(); 551 const gfx::Rect local_bounds = GetLocalBounds();
(...skipping 10 matching lines...) Expand all
561 paint.setAntiAlias(true); 562 paint.setAntiAlias(true);
562 563
563 const gfx::Rect bounds = horizontal_shelf ? gfx::Rect(x, y, width, height) 564 const gfx::Rect bounds = horizontal_shelf ? gfx::Rect(x, y, width, height)
564 : gfx::Rect(y, x, height, width); 565 : gfx::Rect(y, x, height, width);
565 gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale)); 566 gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale));
566 canvas->DrawLine(horizontal_shelf ? rect.top_right() : rect.bottom_left(), 567 canvas->DrawLine(horizontal_shelf ? rect.top_right() : rect.bottom_left(),
567 rect.bottom_right(), paint); 568 rect.bottom_right(), paint);
568 } 569 }
569 570
570 } // namespace ash 571 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698