| 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/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" | 5 #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/keyboard/keyboard_ui.h" | 9 #include "ash/common/keyboard/keyboard_ui.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| 11 #include "ash/common/shelf/shelf_constants.h" | 11 #include "ash/common/shelf/shelf_constants.h" |
| 12 #include "ash/common/shelf/wm_shelf.h" | 12 #include "ash/common/shelf/wm_shelf.h" |
| 13 #include "ash/common/shelf/wm_shelf_util.h" | 13 #include "ash/common/shelf/wm_shelf_util.h" |
| 14 #include "ash/common/system/tray/tray_constants.h" | 14 #include "ash/common/system/tray/tray_constants.h" |
| 15 #include "ash/common/system/tray/tray_utils.h" | 15 #include "ash/common/system/tray/tray_utils.h" |
| 16 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
| 17 #include "ash/common/wm_window.h" | 17 #include "ash/common/wm_window.h" |
| 18 #include "ash/resources/vector_icons/vector_icons.h" |
| 18 #include "grit/ash_resources.h" | 19 #include "grit/ash_resources.h" |
| 19 #include "grit/ash_strings.h" | 20 #include "grit/ash_strings.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/display/display.h" | 23 #include "ui/display/display.h" |
| 23 #include "ui/events/event.h" | 24 #include "ui/events/event.h" |
| 24 #include "ui/gfx/image/image_skia.h" | 25 #include "ui/gfx/image/image_skia.h" |
| 25 #include "ui/gfx/paint_vector_icon.h" | 26 #include "ui/gfx/paint_vector_icon.h" |
| 26 #include "ui/gfx/vector_icons_public.h" | |
| 27 #include "ui/keyboard/keyboard_controller.h" | 27 #include "ui/keyboard/keyboard_controller.h" |
| 28 #include "ui/views/controls/image_view.h" | 28 #include "ui/views/controls/image_view.h" |
| 29 | 29 |
| 30 namespace ash { | 30 namespace ash { |
| 31 | 31 |
| 32 VirtualKeyboardTray::VirtualKeyboardTray(WmShelf* wm_shelf) | 32 VirtualKeyboardTray::VirtualKeyboardTray(WmShelf* wm_shelf) |
| 33 : TrayBackgroundView(wm_shelf), | 33 : TrayBackgroundView(wm_shelf), |
| 34 icon_(new views::ImageView), | 34 icon_(new views::ImageView), |
| 35 wm_shelf_(wm_shelf) { | 35 wm_shelf_(wm_shelf) { |
| 36 if (MaterialDesignController::IsShelfMaterial()) { | 36 if (MaterialDesignController::IsShelfMaterial()) { |
| 37 SetInkDropMode(InkDropMode::ON); | 37 SetInkDropMode(InkDropMode::ON); |
| 38 SetContentsBackground(false); | 38 SetContentsBackground(false); |
| 39 gfx::ImageSkia image_md = | 39 gfx::ImageSkia image_md = |
| 40 CreateVectorIcon(gfx::VectorIconId::SHELF_KEYBOARD, kShelfIconColor); | 40 CreateVectorIcon(kShelfKeyboardIcon, kShelfIconColor); |
| 41 icon_->SetImage(image_md); | 41 icon_->SetImage(image_md); |
| 42 } else { | 42 } else { |
| 43 SetContentsBackground(true); | 43 SetContentsBackground(true); |
| 44 gfx::ImageSkia* image_non_md = | 44 gfx::ImageSkia* image_non_md = |
| 45 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 45 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 46 IDR_AURA_UBER_TRAY_VIRTUAL_KEYBOARD); | 46 IDR_AURA_UBER_TRAY_VIRTUAL_KEYBOARD); |
| 47 icon_->SetImage(image_non_md); | 47 icon_->SetImage(image_non_md); |
| 48 } | 48 } |
| 49 | 49 |
| 50 SetIconBorderForShelfAlignment(); | 50 SetIconBorderForShelfAlignment(); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 void VirtualKeyboardTray::UnobserveKeyboardController() { | 144 void VirtualKeyboardTray::UnobserveKeyboardController() { |
| 145 keyboard::KeyboardController* keyboard_controller = | 145 keyboard::KeyboardController* keyboard_controller = |
| 146 keyboard::KeyboardController::GetInstance(); | 146 keyboard::KeyboardController::GetInstance(); |
| 147 if (keyboard_controller) | 147 if (keyboard_controller) |
| 148 keyboard_controller->RemoveObserver(this); | 148 keyboard_controller->RemoveObserver(this); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace ash | 151 } // namespace ash |
| OLD | NEW |