Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: ash/common/system/chromeos/ime_menu/ime_list_view.cc

Issue 2686623003: Enable tests in TrayIMETest for MD (Closed)
Patch Set: nit Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 if (MaterialDesignController::IsSystemTrayMenuMaterial())
465 return ime_list_view_->material_keyboard_status_view_->toggle();
466
467 return ime_list_view_->keyboard_status_;
tdanderson 2017/02/07 23:27:57 Since none of the tests are being run in non-MD an
mohsen 2017/02/08 02:13:50 Right. Done.
468 }
469
458 } // namespace ash 470 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_list_view.h ('k') | ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698