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

Unified Diff: ash/common/system/chromeos/ime_menu/ime_menu_tray.h

Issue 1996563002: Add ImeMenuTray element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to ash/common/ and use WmWindow. Created 4 years, 6 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/ime_menu/ime_menu_tray.h
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.h b/ash/common/system/chromeos/ime_menu/ime_menu_tray.h
new file mode 100644
index 0000000000000000000000000000000000000000..6d4861506f663eedc64a1ec64850c6b6226cd934
--- /dev/null
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.h
@@ -0,0 +1,70 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_
+#define ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_
+
+#include "ash/ash_export.h"
+#include "ash/common/system/ime/ime_observer.h"
+#include "ash/common/system/tray/system_tray_delegate.h"
James Cook 2016/06/30 21:15:47 not needed
Azure Wei 2016/07/01 03:48:04 This is for IMEInfo.
+#include "ash/common/system/tray/tray_background_view.h"
+#include "ash/common/wm_window_observer.h"
+#include "base/macros.h"
+
+namespace wm {
James Cook 2016/06/30 21:15:47 namespace wm not needed, WmWindow is in namespace
Azure Wei 2016/07/01 03:48:05 Done.
+class WmWindow;
+} // namespace wm
+
+namespace views {
+class Label;
+} // namespace views
+
+namespace ash {
+class StatusAreaWidget;
+
+class ASH_EXPORT ImeMenuTray : public TrayBackgroundView,
+ public IMEObserver,
+ public WmWindowObserver {
+ public:
+ explicit ImeMenuTray(WmShelf* wm_shelf);
+ ~ImeMenuTray() override;
+
+ // Sets the IME menu window.
+ void SetImeWindow(WmWindow* window);
+
+ // TrayBackgroundView:
+ void SetShelfAlignment(ShelfAlignment alignment) override;
+ base::string16 GetAccessibleNameForTray() override;
+ void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override;
+ void ClickedOutsideBubble() override;
+ bool PerformAction(const ui::Event& event) override;
+
+ // IMEObserver:
+ void OnIMERefresh() override;
+ void OnIMEMenuActivationChanged(bool is_activated) override;
+
+ // WmWindowObserver:
+ void OnWindowVisibilityChanging(WmWindow* window, bool visible) override;
+ void OnWindowDestroying(WmWindow* window) override;
+
+ private:
+ // To allow the test class to access GetLabelTextForTest() method.
+ friend class ImeMenuTrayTest;
+
+ // Updates the text of the label on the tray.
+ void UpdateTrayLabel();
+
+ // Sets the border of the label to keep the tray width consistant.
+ void SetLabelBorder();
+
+ views::Label* label_;
+ WmWindow* window_;
+ ash::IMEInfo current_ime_;
James Cook 2016/06/30 21:15:47 ash:: not needed
Azure Wei 2016/07/01 03:48:05 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(ImeMenuTray);
+};
+
+} // namespace ash
+
+#endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_

Powered by Google App Engine
This is Rietveld 408576698