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" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Try unobserving keyboard controller, in case it is not yet destroyed. | 90 // Try unobserving keyboard controller, in case it is not yet destroyed. |
91 UnobserveKeyboardController(); | 91 UnobserveKeyboardController(); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 void VirtualKeyboardTray::OnKeyboardBoundsChanging( | 95 void VirtualKeyboardTray::OnKeyboardBoundsChanging( |
96 const gfx::Rect& new_bounds) { | 96 const gfx::Rect& new_bounds) { |
97 SetDrawBackgroundAsActive(!new_bounds.IsEmpty()); | 97 SetDrawBackgroundAsActive(!new_bounds.IsEmpty()); |
98 } | 98 } |
99 | 99 |
| 100 void VirtualKeyboardTray::OnKeyboardHidden() {} |
| 101 |
100 void VirtualKeyboardTray::SetIconBorderForShelfAlignment() { | 102 void VirtualKeyboardTray::SetIconBorderForShelfAlignment() { |
101 // Every time shelf alignment is updated, StatusAreaWidgetDelegate resets the | 103 // Every time shelf alignment is updated, StatusAreaWidgetDelegate resets the |
102 // border to a non-null border. So, we need to remove it. | 104 // border to a non-null border. So, we need to remove it. |
103 if (!ash::MaterialDesignController::IsShelfMaterial()) | 105 if (!ash::MaterialDesignController::IsShelfMaterial()) |
104 tray_container()->SetBorder(views::Border::NullBorder()); | 106 tray_container()->SetBorder(views::Border::NullBorder()); |
105 const gfx::ImageSkia& image = icon_->GetImage(); | 107 const gfx::ImageSkia& image = icon_->GetImage(); |
106 const int size = GetTrayConstant(VIRTUAL_KEYBOARD_BUTTON_SIZE); | 108 const int size = GetTrayConstant(VIRTUAL_KEYBOARD_BUTTON_SIZE); |
107 const int vertical_padding = (size - image.height()) / 2; | 109 const int vertical_padding = (size - image.height()) / 2; |
108 int horizontal_padding = (size - image.width()) / 2; | 110 int horizontal_padding = (size - image.width()) / 2; |
109 if (!ash::MaterialDesignController::IsShelfMaterial() && | 111 if (!ash::MaterialDesignController::IsShelfMaterial() && |
(...skipping 15 matching lines...) Expand all Loading... |
125 } | 127 } |
126 | 128 |
127 void VirtualKeyboardTray::UnobserveKeyboardController() { | 129 void VirtualKeyboardTray::UnobserveKeyboardController() { |
128 keyboard::KeyboardController* keyboard_controller = | 130 keyboard::KeyboardController* keyboard_controller = |
129 keyboard::KeyboardController::GetInstance(); | 131 keyboard::KeyboardController::GetInstance(); |
130 if (keyboard_controller) | 132 if (keyboard_controller) |
131 keyboard_controller->RemoveObserver(this); | 133 keyboard_controller->RemoveObserver(this); |
132 } | 134 } |
133 | 135 |
134 } // namespace ash | 136 } // namespace ash |
OLD | NEW |