| 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_list_view.h" | 5 #include "ash/common/system/chromeos/ime_menu/ime_list_view.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/system/tray/hover_highlight_view.h" | 8 #include "ash/common/system/tray/hover_highlight_view.h" |
| 9 #include "ash/common/system/tray/ime_info.h" | 9 #include "ash/common/system/tray/ime_info.h" |
| 10 #include "ash/common/system/tray/system_menu_button.h" | 10 #include "ash/common/system/tray/system_menu_button.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 tri_view->AddView(TriView::Container::START, keyboard_image); | 203 tri_view->AddView(TriView::Container::START, keyboard_image); |
| 204 | 204 |
| 205 // The on-screen keyboard label. | 205 // The on-screen keyboard label. |
| 206 label_ = TrayPopupUtils::CreateDefaultLabel(); | 206 label_ = TrayPopupUtils::CreateDefaultLabel(); |
| 207 label_->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 207 label_->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
| 208 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); | 208 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); |
| 209 UpdateStyle(); | 209 UpdateStyle(); |
| 210 tri_view->AddView(TriView::Container::CENTER, label_); | 210 tri_view->AddView(TriView::Container::CENTER, label_); |
| 211 | 211 |
| 212 // The on-screen keyboard toggle button. | 212 // The on-screen keyboard toggle button. |
| 213 toggle_ = new views::ToggleButton(listener_); | 213 toggle_ = TrayPopupUtils::CreateToggleButton( |
| 214 toggle_->SetFocusForPlatform(); | 214 listener_, IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD); |
| 215 toggle_->SetAccessibleName( | |
| 216 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | |
| 217 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); | |
| 218 tri_view->AddView(TriView::Container::END, toggle_); | 215 tri_view->AddView(TriView::Container::END, toggle_); |
| 219 } | 216 } |
| 220 | 217 |
| 221 // Updates the style of |label_| based on the current native theme. | 218 // Updates the style of |label_| based on the current native theme. |
| 222 void UpdateStyle() { | 219 void UpdateStyle() { |
| 223 TrayPopupItemStyle style( | 220 TrayPopupItemStyle style( |
| 224 GetNativeTheme(), TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); | 221 GetNativeTheme(), TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); |
| 225 style.SetupLabel(label_); | 222 style.SetupLabel(label_); |
| 226 } | 223 } |
| 227 | 224 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 396 |
| 400 void ImeListView::HandleButtonPressed(views::Button* sender, | 397 void ImeListView::HandleButtonPressed(views::Button* sender, |
| 401 const ui::Event& event) { | 398 const ui::Event& event) { |
| 402 if (material_keyboard_status_view_ && | 399 if (material_keyboard_status_view_ && |
| 403 sender == material_keyboard_status_view_->toggle()) { | 400 sender == material_keyboard_status_view_->toggle()) { |
| 404 WmShell::Get()->ToggleIgnoreExternalKeyboard(); | 401 WmShell::Get()->ToggleIgnoreExternalKeyboard(); |
| 405 } | 402 } |
| 406 } | 403 } |
| 407 | 404 |
| 408 } // namespace ash | 405 } // namespace ash |
| OLD | NEW |