| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 public: | 139 public: |
| 140 explicit ImeTitleView(bool show_settings_button) : settings_button_(nullptr) { | 140 explicit ImeTitleView(bool show_settings_button) : settings_button_(nullptr) { |
| 141 SetBorder(views::CreatePaddedBorder( | 141 SetBorder(views::CreatePaddedBorder( |
| 142 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, | 142 views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0, |
| 143 kMenuSeparatorColor), | 143 kMenuSeparatorColor), |
| 144 gfx::Insets(kMenuSeparatorVerticalPadding - kSeparatorWidth, 0))); | 144 gfx::Insets(kMenuSeparatorVerticalPadding - kSeparatorWidth, 0))); |
| 145 auto* box_layout = | 145 auto* box_layout = |
| 146 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); | 146 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); |
| 147 box_layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight); | 147 box_layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight); |
| 148 SetLayoutManager(box_layout); | 148 SetLayoutManager(box_layout); |
| 149 auto title_label = | 149 auto* title_label = |
| 150 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME)); | 150 new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME)); |
| 151 title_label->SetBorder( | 151 title_label->SetBorder( |
| 152 views::CreateEmptyBorder(0, kMenuEdgeEffectivePadding, 1, 0)); | 152 views::CreateEmptyBorder(0, kMenuEdgeEffectivePadding, 1, 0)); |
| 153 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 153 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 154 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE); | 154 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE); |
| 155 style.SetupLabel(title_label); | 155 style.SetupLabel(title_label); |
| 156 | 156 |
| 157 AddChildView(title_label); | 157 AddChildView(title_label); |
| 158 box_layout->SetFlexForView(title_label, 1); | 158 box_layout->SetFlexForView(title_label, 1); |
| 159 | 159 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); | 643 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); |
| 644 | 644 |
| 645 // Updates the tray label based on the current input method. | 645 // Updates the tray label based on the current input method. |
| 646 if (current_ime_.third_party) | 646 if (current_ime_.third_party) |
| 647 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); | 647 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); |
| 648 else | 648 else |
| 649 label_->SetText(current_ime_.short_name); | 649 label_->SetText(current_ime_.short_name); |
| 650 } | 650 } |
| 651 | 651 |
| 652 } // namespace ash | 652 } // namespace ash |
| OLD | NEW |