| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" | 5 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/keyboard/keyboard_ui.h" | 7 #include "ash/common/keyboard/keyboard_ui.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 10 #include "ash/common/shelf/wm_shelf_util.h" | 10 #include "ash/common/shelf/wm_shelf_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/events/event.h" | 22 #include "ui/events/event.h" |
| 23 #include "ui/gfx/image/image_skia.h" | 23 #include "ui/gfx/image/image_skia.h" |
| 24 #include "ui/gfx/paint_vector_icon.h" | 24 #include "ui/gfx/paint_vector_icon.h" |
| 25 #include "ui/gfx/vector_icons_public.h" | 25 #include "ui/gfx/vector_icons_public.h" |
| 26 #include "ui/views/controls/button/image_button.h" | 26 #include "ui/views/controls/button/image_button.h" |
| 27 | 27 |
| 28 namespace ash { | 28 namespace ash { |
| 29 | 29 |
| 30 VirtualKeyboardTray::VirtualKeyboardTray(StatusAreaWidget* status_area_widget) | 30 VirtualKeyboardTray::VirtualKeyboardTray(StatusAreaWidget* status_area_widget) |
| 31 : TrayBackgroundView(status_area_widget), | 31 : TrayBackgroundView(status_area_widget->wm_shelf()), button_(nullptr) { |
| 32 button_(NULL) { | |
| 33 button_ = new views::ImageButton(this); | 32 button_ = new views::ImageButton(this); |
| 34 if (MaterialDesignController::IsShelfMaterial()) { | 33 if (MaterialDesignController::IsShelfMaterial()) { |
| 35 gfx::ImageSkia image_md = | 34 gfx::ImageSkia image_md = |
| 36 CreateVectorIcon(gfx::VectorIconId::SHELF_KEYBOARD, kShelfIconColor); | 35 CreateVectorIcon(gfx::VectorIconId::SHELF_KEYBOARD, kShelfIconColor); |
| 37 button_->SetImage(views::CustomButton::STATE_NORMAL, &image_md); | 36 button_->SetImage(views::CustomButton::STATE_NORMAL, &image_md); |
| 38 } else { | 37 } else { |
| 39 gfx::ImageSkia* image_non_md = | 38 gfx::ImageSkia* image_non_md = |
| 40 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 39 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 41 IDR_AURA_UBER_TRAY_VIRTUAL_KEYBOARD); | 40 IDR_AURA_UBER_TRAY_VIRTUAL_KEYBOARD); |
| 42 button_->SetImage(views::CustomButton::STATE_NORMAL, image_non_md); | 41 button_->SetImage(views::CustomButton::STATE_NORMAL, image_non_md); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const ui::Event& event) { | 104 const ui::Event& event) { |
| 106 DCHECK_EQ(button_, sender); | 105 DCHECK_EQ(button_, sender); |
| 107 PerformAction(event); | 106 PerformAction(event); |
| 108 } | 107 } |
| 109 | 108 |
| 110 void VirtualKeyboardTray::OnKeyboardEnabledStateChanged(bool new_value) { | 109 void VirtualKeyboardTray::OnKeyboardEnabledStateChanged(bool new_value) { |
| 111 SetVisible(Shell::GetInstance()->keyboard_ui()->IsEnabled()); | 110 SetVisible(Shell::GetInstance()->keyboard_ui()->IsEnabled()); |
| 112 } | 111 } |
| 113 | 112 |
| 114 } // namespace ash | 113 } // namespace ash |
| OLD | NEW |