| 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/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/ash_constants.h" | 8 #include "ash/common/ash_constants.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 explicit ImeTitleView(bool show_settings_button) : settings_button_(nullptr) { | 143 explicit ImeTitleView(bool show_settings_button) : settings_button_(nullptr) { |
| 144 SetBorder(views::CreatePaddedBorder( | 144 SetBorder(views::CreatePaddedBorder( |
| 145 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, | 145 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, |
| 146 kMenuSeparatorColor), | 146 kMenuSeparatorColor), |
| 147 gfx::Insets(kMenuSeparatorVerticalPadding - kSeparatorWidth, 0))); | 147 gfx::Insets(kMenuSeparatorVerticalPadding - kSeparatorWidth, 0))); |
| 148 auto* box_layout = | 148 auto* box_layout = |
| 149 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); | 149 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); |
| 150 box_layout->set_minimum_cross_axis_size( | 150 box_layout->set_minimum_cross_axis_size( |
| 151 GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT)); | 151 GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT)); |
| 152 SetLayoutManager(box_layout); | 152 SetLayoutManager(box_layout); |
| 153 auto title_label = | 153 auto* title_label = |
| 154 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME)); | 154 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME)); |
| 155 title_label->SetBorder( | 155 title_label->SetBorder( |
| 156 views::CreateEmptyBorder(0, kMenuEdgeEffectivePadding, 1, 0)); | 156 views::CreateEmptyBorder(0, kMenuEdgeEffectivePadding, 1, 0)); |
| 157 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 157 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 158 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE); | 158 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE); |
| 159 style.SetupLabel(title_label); | 159 style.SetupLabel(title_label); |
| 160 | 160 |
| 161 AddChildView(title_label); | 161 AddChildView(title_label); |
| 162 box_layout->SetFlexForView(title_label, 1); | 162 box_layout->SetFlexForView(title_label, 1); |
| 163 | 163 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); | 648 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); |
| 649 | 649 |
| 650 // Updates the tray label based on the current input method. | 650 // Updates the tray label based on the current input method. |
| 651 if (current_ime_.third_party) | 651 if (current_ime_.third_party) |
| 652 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); | 652 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); |
| 653 else | 653 else |
| 654 label_->SetText(current_ime_.short_name); | 654 label_->SetText(current_ime_.short_name); |
| 655 } | 655 } |
| 656 | 656 |
| 657 } // namespace ash | 657 } // namespace ash |
| OLD | NEW |