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/shelf/shelf_constants.h" | 7 #include "ash/shelf/shelf_constants.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/status_area_widget.h" | 9 #include "ash/system/status_area_widget.h" |
10 #include "ash/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
23 namespace { | 23 namespace { |
24 | 24 |
25 class VirtualKeyboardButton : public views::ImageButton { | 25 class VirtualKeyboardButton : public views::ImageButton { |
26 public: | 26 public: |
27 VirtualKeyboardButton(views::ButtonListener* listener); | 27 VirtualKeyboardButton(views::ButtonListener* listener); |
28 virtual ~VirtualKeyboardButton(); | 28 virtual ~VirtualKeyboardButton(); |
29 | 29 |
30 // Overridden from views::ImageButton: | 30 // Overridden from views::ImageButton: |
31 virtual gfx::Size GetPreferredSize() OVERRIDE; | 31 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
32 | 32 |
33 private: | 33 private: |
34 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardButton); | 34 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardButton); |
35 }; | 35 }; |
36 | 36 |
37 VirtualKeyboardButton::VirtualKeyboardButton(views::ButtonListener* listener) | 37 VirtualKeyboardButton::VirtualKeyboardButton(views::ButtonListener* listener) |
38 : views::ImageButton(listener) { | 38 : views::ImageButton(listener) { |
39 } | 39 } |
40 | 40 |
41 VirtualKeyboardButton::~VirtualKeyboardButton() { | 41 VirtualKeyboardButton::~VirtualKeyboardButton() { |
42 } | 42 } |
43 | 43 |
44 gfx::Size VirtualKeyboardButton::GetPreferredSize() { | 44 gfx::Size VirtualKeyboardButton::GetPreferredSize() const { |
45 const int virtual_keyboard_button_height = kShelfSize; | 45 const int virtual_keyboard_button_height = kShelfSize; |
46 gfx::Size size = ImageButton::GetPreferredSize(); | 46 gfx::Size size = ImageButton::GetPreferredSize(); |
47 int padding = virtual_keyboard_button_height - size.height(); | 47 int padding = virtual_keyboard_button_height - size.height(); |
48 size.set_height(virtual_keyboard_button_height); | 48 size.set_height(virtual_keyboard_button_height); |
49 size.set_width(size.width() + padding); | 49 size.set_width(size.width() + padding); |
50 return size; | 50 return size; |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 PerformAction(event); | 109 PerformAction(event); |
110 } | 110 } |
111 | 111 |
112 void VirtualKeyboardTray::OnAccessibilityModeChanged( | 112 void VirtualKeyboardTray::OnAccessibilityModeChanged( |
113 AccessibilityNotificationVisibility notify) { | 113 AccessibilityNotificationVisibility notify) { |
114 SetVisible(Shell::GetInstance()->accessibility_delegate()-> | 114 SetVisible(Shell::GetInstance()->accessibility_delegate()-> |
115 IsVirtualKeyboardEnabled()); | 115 IsVirtualKeyboardEnabled()); |
116 } | 116 } |
117 | 117 |
118 } // namespace ash | 118 } // namespace ash |
OLD | NEW |