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

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

Issue 2709903004: Consolidate some more ash tray constants. (Closed)
Patch Set: rebase/review Created 3 years, 9 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 | « ash/common/system/tray/throbber_view.cc ('k') | ash/common/system/tray/tray_constants.h » ('j') | 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 std::unique_ptr<views::InkDropHighlight> 409 std::unique_ptr<views::InkDropHighlight>
410 TrayBackgroundView::CreateInkDropHighlight() const { 410 TrayBackgroundView::CreateInkDropHighlight() const {
411 gfx::Rect bounds = GetBackgroundBounds(); 411 gfx::Rect bounds = GetBackgroundBounds();
412 // Currently, we don't handle view resize. To compensate for that, enlarge the 412 // Currently, we don't handle view resize. To compensate for that, enlarge the
413 // bounds by two tray icons so that the hightlight looks good even if two more 413 // bounds by two tray icons so that the hightlight looks good even if two more
414 // icons are added when it is visible. Note that ink drop mask handles resize 414 // icons are added when it is visible. Note that ink drop mask handles resize
415 // correctly, so the extra highlight would be clipped. 415 // correctly, so the extra highlight would be clipped.
416 // TODO(mohsen): Remove this extra size when resize is handled properly (see 416 // TODO(mohsen): Remove this extra size when resize is handled properly (see
417 // https://crbug.com/669253). 417 // https://crbug.com/669253).
418 const int icon_size = 418 const int icon_size = kTrayIconSize + 2 * kTrayImageItemPadding;
419 kTrayIconSize + 2 * GetTrayConstant(TRAY_IMAGE_ITEM_PADDING);
420 bounds.set_width(bounds.width() + 2 * icon_size); 419 bounds.set_width(bounds.width() + 2 * icon_size);
421 bounds.set_height(bounds.height() + 2 * icon_size); 420 bounds.set_height(bounds.height() + 2 * icon_size);
422 std::unique_ptr<views::InkDropHighlight> highlight( 421 std::unique_ptr<views::InkDropHighlight> highlight(
423 new views::InkDropHighlight(bounds.size(), 0, 422 new views::InkDropHighlight(bounds.size(), 0,
424 gfx::RectF(bounds).CenterPoint(), 423 gfx::RectF(bounds).CenterPoint(),
425 GetInkDropBaseColor())); 424 GetInkDropBaseColor()));
426 highlight->set_visible_opacity(kTrayPopupInkDropHighlightOpacity); 425 highlight->set_visible_opacity(kTrayPopupInkDropHighlightOpacity);
427 return highlight; 426 return highlight;
428 } 427 }
429 428
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 632 }
634 633
635 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { 634 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const {
636 gfx::Insets insets = GetBackgroundInsets(); 635 gfx::Insets insets = GetBackgroundInsets();
637 gfx::Rect bounds = GetLocalBounds(); 636 gfx::Rect bounds = GetLocalBounds();
638 bounds.Inset(insets); 637 bounds.Inset(insets);
639 return bounds; 638 return bounds;
640 } 639 }
641 640
642 } // namespace ash 641 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/throbber_view.cc ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698