| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 tri_view->AddView(TriView::Container::START, keyboard_image); | 216 tri_view->AddView(TriView::Container::START, keyboard_image); |
| 217 | 217 |
| 218 // The on-screen keyboard label. | 218 // The on-screen keyboard label. |
| 219 label_ = TrayPopupUtils::CreateDefaultLabel(); | 219 label_ = TrayPopupUtils::CreateDefaultLabel(); |
| 220 label_->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 220 label_->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
| 221 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); | 221 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); |
| 222 UpdateStyle(); | 222 UpdateStyle(); |
| 223 tri_view->AddView(TriView::Container::CENTER, label_); | 223 tri_view->AddView(TriView::Container::CENTER, label_); |
| 224 | 224 |
| 225 // The on-screen keyboard toggle button. | 225 // The on-screen keyboard toggle button. |
| 226 toggle_ = new views::ToggleButton(listener_); | 226 toggle_ = TrayPopupUtils::CreateToggleButton( |
| 227 toggle_->SetFocusForPlatform(); | 227 listener_, IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD); |
| 228 toggle_->SetAccessibleName( | |
| 229 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | |
| 230 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); | |
| 231 tri_view->AddView(TriView::Container::END, toggle_); | 228 tri_view->AddView(TriView::Container::END, toggle_); |
| 232 } | 229 } |
| 233 | 230 |
| 234 // Updates the style of |label_| based on the current native theme. | 231 // Updates the style of |label_| based on the current native theme. |
| 235 void UpdateStyle() { | 232 void UpdateStyle() { |
| 236 TrayPopupItemStyle style( | 233 TrayPopupItemStyle style( |
| 237 GetNativeTheme(), TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); | 234 GetNativeTheme(), TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); |
| 238 style.SetupLabel(label_); | 235 style.SetupLabel(label_); |
| 239 } | 236 } |
| 240 | 237 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 } | 406 } |
| 410 | 407 |
| 411 void ImeListView::HandleButtonPressed(views::Button* sender, | 408 void ImeListView::HandleButtonPressed(views::Button* sender, |
| 412 const ui::Event& event) { | 409 const ui::Event& event) { |
| 413 DCHECK(material_keyboard_status_view_); | 410 DCHECK(material_keyboard_status_view_); |
| 414 DCHECK_EQ(sender, material_keyboard_status_view_->toggle()); | 411 DCHECK_EQ(sender, material_keyboard_status_view_->toggle()); |
| 415 WmShell::Get()->ToggleIgnoreExternalKeyboard(); | 412 WmShell::Get()->ToggleIgnoreExternalKeyboard(); |
| 416 } | 413 } |
| 417 | 414 |
| 418 } // namespace ash | 415 } // namespace ash |
| OLD | NEW |