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

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

Issue 2271523002: Adds emoji/handwriting/vocie buttons on opt-in IME menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments and sync. Created 4 years, 3 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/tray_constants.h ('k') | ash/resources/vector_icons/BUILD.gn » ('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_constants.h" 5 #include "ash/common/system/tray/tray_constants.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 "base/logging.h" 8 #include "base/logging.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/gfx/color_palette.h" 10 #include "ui/gfx/color_palette.h"
(...skipping 12 matching lines...) Expand all
23 const int kBubblePaddingVerticalBottom = 3; 23 const int kBubblePaddingVerticalBottom = 3;
24 const int kBubblePaddingVerticalSide = 15; 24 const int kBubblePaddingVerticalSide = 15;
25 25
26 // Top inset of system tray bubble for bottom anchor alignment. 26 // Top inset of system tray bubble for bottom anchor alignment.
27 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; 27 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3;
28 28
29 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; 29 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1;
30 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; 30 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1;
31 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; 31 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1;
32 32
33 // Size of IME menu tray.
34 const int kTrayImeIconSize = 40;
35 const int kTrayImeBottomRowPadding = 5;
36 const int kTrayImeBottomRowPaddingBetweenItems = 2;
37
38 // Size of tray items on the primary axis. 33 // Size of tray items on the primary axis.
39 const int kTrayItemSize = 32; 34 const int kTrayItemSize = 32;
40 35
41 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7; 36 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7;
42 37
43 // Vertical padding between status tray items when the shelf is vertical. 38 // Vertical padding between status tray items when the shelf is vertical.
44 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4; 39 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4;
45 40
46 const int kTrayMenuBottomRowPadding = 5; 41 const int kTrayMenuBottomRowPadding = 5;
47 const int kTrayMenuBottomRowPaddingBetweenItems = -1; 42 const int kTrayMenuBottomRowPaddingBetweenItems = -1;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const int kTrayNotificationContentsWidth = 77 const int kTrayNotificationContentsWidth =
83 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth + 78 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth +
84 (kTrayPopupPaddingHorizontal / 2) * 3); 79 (kTrayPopupPaddingHorizontal / 2) * 3);
85 80
86 const int kMessageCenterBubblePadding = 4; 81 const int kMessageCenterBubblePadding = 4;
87 82
88 const int kTrayIconSize = 16; 83 const int kTrayIconSize = 16;
89 const SkColor kTrayIconColor = SK_ColorWHITE; 84 const SkColor kTrayIconColor = SK_ColorWHITE;
90 const int kMenuIconSize = 20; 85 const int kMenuIconSize = 20;
91 const SkColor kMenuIconColor = gfx::kChromeIconGrey; 86 const SkColor kMenuIconColor = gfx::kChromeIconGrey;
87 const int kMenuButtonSize = 48;
92 88
93 const int kHitRegionPadding = 4; 89 const int kHitRegionPadding = 4;
94 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D); 90 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D);
95 const int kSeparatorWidth = 1; 91 const int kSeparatorWidth = 1;
96 92
97 int GetTrayConstant(TrayConstant constant) { 93 int GetTrayConstant(TrayConstant constant) {
98 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; 94 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize};
99 const int kTraySpacing[] = {4, 4, 0}; 95 const int kTraySpacing[] = {4, 4, 0};
100 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; 96 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4};
101 const int kTrayPopupItemHeight[] = {46, 46, 48}; 97 const int kTrayPopupItemHeight[] = {46, 46, 48};
102 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; 98 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize};
99 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize};
103 100
104 const int mode = MaterialDesignController::GetMode(); 101 const int mode = MaterialDesignController::GetMode();
105 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && 102 DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
106 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); 103 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
107 104
108 switch (constant) { 105 switch (constant) {
109 case TRAY_ITEM_HEIGHT_LEGACY: 106 case TRAY_ITEM_HEIGHT_LEGACY:
110 return kTrayItemHeightLegacy[mode]; 107 return kTrayItemHeightLegacy[mode];
111 case TRAY_SPACING: 108 case TRAY_SPACING:
112 return kTraySpacing[mode]; 109 return kTraySpacing[mode];
113 case TRAY_PADDING_FROM_EDGE_OF_SHELF: 110 case TRAY_PADDING_FROM_EDGE_OF_SHELF:
114 return kTrayPaddingFromEdgeOfShelf[mode]; 111 return kTrayPaddingFromEdgeOfShelf[mode];
115 case TRAY_POPUP_ITEM_HEIGHT: 112 case TRAY_POPUP_ITEM_HEIGHT:
116 return kTrayPopupItemHeight[mode]; 113 return kTrayPopupItemHeight[mode];
117 case VIRTUAL_KEYBOARD_BUTTON_SIZE: 114 case VIRTUAL_KEYBOARD_BUTTON_SIZE:
118 return kVirtualKeyboardButtonSize[mode]; 115 return kVirtualKeyboardButtonSize[mode];
116 case TRAY_IME_MENU_ICON:
117 return kTrayImeMenuIcon[mode];
119 } 118 }
120 NOTREACHED(); 119 NOTREACHED();
121 return 0; 120 return 0;
122 } 121 }
123 122
124 } // namespace ash 123 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698