| Index: ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
|
| diff --git a/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc b/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
|
| index 63eadf15bd9cc6aeeabf12619078ceae386b492d..2dadd1f34715c703e9439d802284e69f09be89ca 100644
|
| --- a/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
|
| +++ b/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
|
|
|
| +#include "ash/shelf/shelf.h"
|
| #include "ash/shelf/shelf_constants.h"
|
| #include "ash/shell.h"
|
| #include "ash/system/status_area_widget.h"
|
| @@ -44,7 +45,11 @@ VirtualKeyboardButton::~VirtualKeyboardButton() {
|
| gfx::Size VirtualKeyboardButton::GetPreferredSize() const {
|
| const int virtual_keyboard_button_height = kShelfSize;
|
| gfx::Size size = ImageButton::GetPreferredSize();
|
| - int padding = virtual_keyboard_button_height - size.height();
|
| + Shelf* shelf = Shelf::ForPrimaryDisplay();
|
| + bool is_horizontal = shelf && (shelf->alignment() == SHELF_ALIGNMENT_BOTTOM ||
|
| + shelf->alignment() == SHELF_ALIGNMENT_TOP);
|
| + int padding = is_horizontal ? virtual_keyboard_button_height - size.height() :
|
| + 0;
|
| size.set_height(virtual_keyboard_button_height);
|
| size.set_width(size.width() + padding);
|
| return size;
|
|
|