OLD | NEW |
---|---|
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/chromeos/ime_menu/ime_menu_tray.h" | 5 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.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/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
9 #include "ash/common/shelf/wm_shelf_util.h" | 9 #include "ash/common/shelf/wm_shelf_util.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 SetBorder( | 73 SetBorder( |
74 views::Border::CreateSolidSidedBorder(1, 0, 0, 0, kBorderDarkColor)); | 74 views::Border::CreateSolidSidedBorder(1, 0, 0, 0, kBorderDarkColor)); |
75 | 75 |
76 auto* box_layout = new views::BoxLayout( | 76 auto* box_layout = new views::BoxLayout( |
77 views::BoxLayout::kHorizontal, kTrayImeBottomRowPadding, | 77 views::BoxLayout::kHorizontal, kTrayImeBottomRowPadding, |
78 kTrayImeBottomRowPadding, kTrayImeBottomRowPaddingBetweenItems); | 78 kTrayImeBottomRowPadding, kTrayImeBottomRowPaddingBetweenItems); |
79 box_layout->SetDefaultFlex(1); | 79 box_layout->SetDefaultFlex(1); |
80 SetLayoutManager(box_layout); | 80 SetLayoutManager(box_layout); |
81 | 81 |
82 if (show_emoji_button) { | 82 if (show_emoji_button) { |
83 // TODO(azurewei): Creates the proper button with icons. | 83 emoji_button_ = CreateImeMenuButton( |
84 this, IDR_AURA_UBER_TRAY_EMOJI, IDR_AURA_UBER_TRAY_EMOJI, | |
85 IDR_AURA_UBER_TRAY_EMOJI, IDR_AURA_UBER_TRAY_EMOJI, | |
86 IDS_ASH_STATUS_TRAY_EMOJI, IDS_ASH_STATUS_TRAY_EMOJI, 1); | |
James Cook
2016/08/23 16:01:22
nit: Use a constant for 1, like const int right_bo
Azure Wei
2016/09/18 05:40:02
Removed this border.
| |
87 AddChildView(emoji_button_); | |
84 } | 88 } |
85 | 89 |
86 if (show_voice_button) { | 90 if (show_voice_button) { |
87 // TODO(azurewei): Creates the proper button with icons. | 91 voice_button_ = CreateImeMenuButton( |
92 this, IDR_AURA_UBER_TRAY_VOICE, IDR_AURA_UBER_TRAY_VOICE, | |
93 IDR_AURA_UBER_TRAY_VOICE, IDR_AURA_UBER_TRAY_VOICE, | |
James Cook
2016/08/23 16:01:22
Should there be separate artwork for the disabled
Azure Wei
2016/09/18 05:40:02
Updated with vectorized icons instead of PNGs.
| |
94 IDS_ASH_STATUS_TRAY_VOICE, IDS_ASH_STATUS_TRAY_VOICE, 1); | |
95 AddChildView(voice_button_); | |
88 } | 96 } |
89 | 97 |
90 if (show_handwriting_button) { | 98 if (show_handwriting_button) { |
91 // TODO(azurewei): Creates the proper button with icons. | 99 handwriting_button_ = CreateImeMenuButton( |
100 this, IDR_AURA_UBER_TRAY_HANDWRITING, IDR_AURA_UBER_TRAY_HANDWRITING, | |
101 IDR_AURA_UBER_TRAY_HANDWRITING, IDR_AURA_UBER_TRAY_HANDWRITING, | |
102 IDS_ASH_STATUS_TRAY_HANDWRITING, IDS_ASH_STATUS_TRAY_HANDWRITING, 1); | |
103 AddChildView(handwriting_button_); | |
92 } | 104 } |
93 | 105 |
94 if (show_settings_button) { | 106 if (show_settings_button) { |
95 settings_button_ = CreateImeMenuButton( | 107 settings_button_ = CreateImeMenuButton( |
96 this, IDR_AURA_UBER_TRAY_SETTINGS, IDR_AURA_UBER_TRAY_SETTINGS, | 108 this, IDR_AURA_UBER_TRAY_SETTINGS, IDR_AURA_UBER_TRAY_SETTINGS, |
97 IDR_AURA_UBER_TRAY_SETTINGS, IDR_AURA_UBER_TRAY_SETTINGS, | 109 IDR_AURA_UBER_TRAY_SETTINGS, IDR_AURA_UBER_TRAY_SETTINGS, |
98 IDS_ASH_STATUS_TRAY_SETTINGS, IDS_ASH_STATUS_TRAY_SETTINGS, 0); | 110 IDS_ASH_STATUS_TRAY_SETTINGS, IDS_ASH_STATUS_TRAY_SETTINGS, 0); |
99 AddChildView(settings_button_); | 111 AddChildView(settings_button_); |
100 } | 112 } |
101 } | 113 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view)); | 286 bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view)); |
275 SetDrawBackgroundAsActive(true); | 287 SetDrawBackgroundAsActive(true); |
276 } | 288 } |
277 | 289 |
278 void ImeMenuTray::HideImeMenuBubble() { | 290 void ImeMenuTray::HideImeMenuBubble() { |
279 bubble_.reset(); | 291 bubble_.reset(); |
280 SetDrawBackgroundAsActive(false); | 292 SetDrawBackgroundAsActive(false); |
281 } | 293 } |
282 | 294 |
283 } // namespace ash | 295 } // namespace ash |
OLD | NEW |