Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h

Issue 2201323002: Simplify VirtualKeyboardTray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
diff --git a/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h b/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
index a52dc196692e01adee8399fb0d4c540e62bff8c6..04847be48ca6e4ee0f29d0bea72f41dc253ebba7 100644
--- a/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
+++ b/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
@@ -8,18 +8,18 @@
#include "ash/common/keyboard/keyboard_ui_observer.h"
#include "ash/common/system/tray/tray_background_view.h"
#include "base/macros.h"
-#include "ui/views/controls/button/button.h"
+#include "ui/keyboard/keyboard_controller_observer.h"
namespace views {
-class ImageButton;
+class ImageView;
}
namespace ash {
// TODO(sky): make this visible on non-chromeos platforms.
class VirtualKeyboardTray : public TrayBackgroundView,
- public views::ButtonListener,
- public KeyboardUIObserver {
+ public KeyboardUIObserver,
+ public keyboard::KeyboardControllerObserver {
public:
explicit VirtualKeyboardTray(WmShelf* wm_shelf);
~VirtualKeyboardTray() override;
@@ -31,14 +31,22 @@ class VirtualKeyboardTray : public TrayBackgroundView,
void ClickedOutsideBubble() override;
bool PerformAction(const ui::Event& event) override;
- // views::ButtonListener:
- void ButtonPressed(views::Button* sender, const ui::Event& event) override;
-
// KeyboardUIObserver:
- void OnKeyboardEnabledStateChanged(bool new_value) override;
+ void OnKeyboardEnabledStateChanged(bool new_enabled) override;
+
+ // keyboard::KeyboardControllerObserver:
+ void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override;
private:
- views::ImageButton* button_; // Not owned.
+ // Creates a new border for the icon. The padding is determined based on the
+ // alignment of the shelf.
+ void SetIconBorderForShelfAlignment();
+
+ void ObserveKeyboardController();
+ void UnobserveKeyboardController();
+
+ // Weak pointer, will be parented by TrayContainer for its lifetime.
+ views::ImageView* icon_;
DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardTray);
};
« no previous file with comments | « ash/common/keyboard/keyboard_ui_observer.h ('k') | ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698