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

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

Issue 2795143005: [Ash] Remove pre-MD code paths from HoverHighlightView (Closed)
Patch Set: estade comments Created 3 years, 8 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // A |HoverHighlightView| that uses bold or normal font depending on whether it 47 // A |HoverHighlightView| that uses bold or normal font depending on whether it
48 // is selected. This view exposes itself as a checkbox to the accessibility 48 // is selected. This view exposes itself as a checkbox to the accessibility
49 // framework. 49 // framework.
50 class SelectableHoverHighlightView : public HoverHighlightView { 50 class SelectableHoverHighlightView : public HoverHighlightView {
51 public: 51 public:
52 SelectableHoverHighlightView(ViewClickListener* listener, 52 SelectableHoverHighlightView(ViewClickListener* listener,
53 const base::string16& label, 53 const base::string16& label,
54 bool selected) 54 bool selected)
55 : HoverHighlightView(listener), selected_(selected) { 55 : HoverHighlightView(listener), selected_(selected) {
56 AddLabel(label, gfx::ALIGN_LEFT, selected); 56 AddLabelDeprecated(label, gfx::ALIGN_LEFT, selected);
57 } 57 }
58 58
59 ~SelectableHoverHighlightView() override {} 59 ~SelectableHoverHighlightView() override {}
60 60
61 protected: 61 protected:
62 // views::View: 62 // views::View:
63 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { 63 void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
64 HoverHighlightView::GetAccessibleNodeData(node_data); 64 HoverHighlightView::GetAccessibleNodeData(node_data);
65 node_data->role = ui::AX_ROLE_CHECK_BOX; 65 node_data->role = ui::AX_ROLE_CHECK_BOX;
66 if (selected_) 66 if (selected_)
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 TrayPopupUtils::CreateListItemSeparator(true)); 364 TrayPopupUtils::CreateListItemSeparator(true));
365 } 365 }
366 } 366 }
367 } 367 }
368 368
369 void ImeListView::AppendKeyboardStatus() { 369 void ImeListView::AppendKeyboardStatus() {
370 DCHECK(!MaterialDesignController::IsSystemTrayMenuMaterial()); 370 DCHECK(!MaterialDesignController::IsSystemTrayMenuMaterial());
371 HoverHighlightView* container = new HoverHighlightView(this); 371 HoverHighlightView* container = new HoverHighlightView(this);
372 int id = keyboard::IsKeyboardEnabled() ? IDS_ASH_STATUS_TRAY_DISABLE_KEYBOARD 372 int id = keyboard::IsKeyboardEnabled() ? IDS_ASH_STATUS_TRAY_DISABLE_KEYBOARD
373 : IDS_ASH_STATUS_TRAY_ENABLE_KEYBOARD; 373 : IDS_ASH_STATUS_TRAY_ENABLE_KEYBOARD;
374 container->AddLabel( 374 container->AddLabelDeprecated(
375 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(id), 375 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(id),
376 gfx::ALIGN_LEFT, false /* highlight */); 376 gfx::ALIGN_LEFT, false /* highlight */);
377 scroll_content()->AddChildView(container); 377 scroll_content()->AddChildView(container);
378 keyboard_status_ = container; 378 keyboard_status_ = container;
379 } 379 }
380 380
381 void ImeListView::PrependMaterialKeyboardStatus() { 381 void ImeListView::PrependMaterialKeyboardStatus() {
382 DCHECK(MaterialDesignController::IsSystemTrayMenuMaterial()); 382 DCHECK(MaterialDesignController::IsSystemTrayMenuMaterial());
383 DCHECK(!material_keyboard_status_view_); 383 DCHECK(!material_keyboard_status_view_);
384 MaterialKeyboardStatusRowView* view = 384 MaterialKeyboardStatusRowView* view =
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) 461 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view)
462 : ime_list_view_(ime_list_view) {} 462 : ime_list_view_(ime_list_view) {}
463 463
464 ImeListViewTestApi::~ImeListViewTestApi() {} 464 ImeListViewTestApi::~ImeListViewTestApi() {}
465 465
466 views::View* ImeListViewTestApi::GetToggleView() const { 466 views::View* ImeListViewTestApi::GetToggleView() const {
467 return ime_list_view_->material_keyboard_status_view_->toggle(); 467 return ime_list_view_->material_keyboard_status_view_->toggle();
468 } 468 }
469 469
470 } // namespace ash 470 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698