| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 class MaterialKeyboardStatusRowView : public views::View { | 173 class MaterialKeyboardStatusRowView : public views::View { |
| 174 public: | 174 public: |
| 175 MaterialKeyboardStatusRowView(views::ButtonListener* listener, bool enabled) | 175 MaterialKeyboardStatusRowView(views::ButtonListener* listener, bool enabled) |
| 176 : listener_(listener), toggle_(nullptr) { | 176 : listener_(listener), toggle_(nullptr) { |
| 177 Init(); | 177 Init(); |
| 178 toggle_->SetIsOn(enabled, false); | 178 toggle_->SetIsOn(enabled, false); |
| 179 } | 179 } |
| 180 | 180 |
| 181 ~MaterialKeyboardStatusRowView() override {} | 181 ~MaterialKeyboardStatusRowView() override {} |
| 182 | 182 |
| 183 const views::Button* toggle() const { return toggle_; } | 183 views::Button* toggle() const { return toggle_; } |
| 184 bool is_toggled() const { return toggle_->is_on(); } | 184 bool is_toggled() const { return toggle_->is_on(); } |
| 185 | 185 |
| 186 protected: | 186 protected: |
| 187 // views::View: | 187 // views::View: |
| 188 int GetHeightForWidth(int w) const override { | 188 int GetHeightForWidth(int w) const override { |
| 189 return GetPreferredSize().height(); | 189 return GetPreferredSize().height(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 private: | 192 private: |
| 193 void Init() { | 193 void Init() { |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 } | 448 } |
| 449 | 449 |
| 450 for (auto property_map : property_map_) { | 450 for (auto property_map : property_map_) { |
| 451 if (property_map.second == last_selected_item_id_) { | 451 if (property_map.second == last_selected_item_id_) { |
| 452 (property_map.first)->RequestFocus(); | 452 (property_map.first)->RequestFocus(); |
| 453 return; | 453 return; |
| 454 } | 454 } |
| 455 } | 455 } |
| 456 } | 456 } |
| 457 | 457 |
| 458 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) |
| 459 : ime_list_view_(ime_list_view) {} |
| 460 |
| 461 ImeListViewTestApi::~ImeListViewTestApi() {} |
| 462 |
| 463 views::View* ImeListViewTestApi::GetToggleView() const { |
| 464 return ime_list_view_->material_keyboard_status_view_->toggle(); |
| 465 } |
| 466 |
| 458 } // namespace ash | 467 } // namespace ash |
| OLD | NEW |