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

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

Issue 2709903004: Consolidate some more ash tray constants. (Closed)
Patch Set: rebase 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
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_utils.h" 5 #include "ash/common/system/tray/tray_utils.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/wm_shelf_util.h" 8 #include "ash/common/shelf/wm_shelf_util.h"
9 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
10 #include "ash/common/system/tray/tray_item_view.h" 10 #include "ash/common/system/tray/tray_item_view.h"
(...skipping 23 matching lines...) Expand all
34 label->SetAutoColorReadabilityEnabled(false); 34 label->SetAutoColorReadabilityEnabled(false);
35 label->SetEnabledColor(SK_ColorWHITE); 35 label->SetEnabledColor(SK_ColorWHITE);
36 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); 36 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255));
37 } 37 }
38 } 38 }
39 39
40 void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment) { 40 void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment) {
41 if (MaterialDesignController::IsShelfMaterial()) 41 if (MaterialDesignController::IsShelfMaterial())
42 return; 42 return;
43 43
44 const int tray_image_item_padding = GetTrayConstant(TRAY_IMAGE_ITEM_PADDING); 44 const int tray_image_item_padding = kTrayImageItemPadding;
tdanderson 2017/02/28 17:08:18 nit: local variable no longer needed, just use the
Evan Stade 2017/03/01 04:28:54 Done.
45 if (IsHorizontalAlignment(alignment)) { 45 if (IsHorizontalAlignment(alignment)) {
46 tray_view->SetBorder(views::CreateEmptyBorder(0, tray_image_item_padding, 0, 46 tray_view->SetBorder(views::CreateEmptyBorder(0, tray_image_item_padding, 0,
47 tray_image_item_padding)); 47 tray_image_item_padding));
48 } else { 48 } else {
49 tray_view->SetBorder(views::CreateEmptyBorder( 49 tray_view->SetBorder(views::CreateEmptyBorder(
50 tray_image_item_padding, 50 tray_image_item_padding,
51 kTrayImageItemHorizontalPaddingVerticalAlignment, 51 kTrayImageItemHorizontalPaddingVerticalAlignment,
52 tray_image_item_padding, 52 tray_image_item_padding,
53 kTrayImageItemHorizontalPaddingVerticalAlignment)); 53 kTrayImageItemHorizontalPaddingVerticalAlignment));
54 } 54 }
(...skipping 13 matching lines...) Expand all
68 std::max(0, (tray_view->GetPreferredSize().width() - 68 std::max(0, (tray_view->GetPreferredSize().width() -
69 tray_view->label()->GetPreferredSize().width()) / 69 tray_view->label()->GetPreferredSize().width()) /
70 2); 70 2);
71 tray_view->SetBorder(views::CreateEmptyBorder( 71 tray_view->SetBorder(views::CreateEmptyBorder(
72 kTrayLabelItemVerticalPaddingVerticalAlignment, horizontal_padding, 72 kTrayLabelItemVerticalPaddingVerticalAlignment, horizontal_padding,
73 kTrayLabelItemVerticalPaddingVerticalAlignment, horizontal_padding)); 73 kTrayLabelItemVerticalPaddingVerticalAlignment, horizontal_padding));
74 } 74 }
75 } 75 }
76 76
77 } // namespace ash 77 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698