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