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

Unified Diff: ash/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: sync code. 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
« no previous file with comments | « ash/shelf/shelf_util.cc ('k') | ash/system/chromeos/ime_menu/ime_menu_tray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/ime_menu/ime_menu_tray.h
diff --git a/ash/system/chromeos/ime_menu/ime_menu_tray.h b/ash/system/chromeos/ime_menu/ime_menu_tray.h
new file mode 100644
index 0000000000000000000000000000000000000000..c1b8b21aaba8338050ca8b786b70fc166590997a
--- /dev/null
+++ b/ash/system/chromeos/ime_menu/ime_menu_tray.h
@@ -0,0 +1,66 @@
+// 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_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_
+#define ASH_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"
+#include "ash/common/system/tray/tray_background_view.h"
+#include "ash/common/wm/window_state_observer.h"
+#include "base/macros.h"
+
+namespace views {
+class Label;
+}
+
+namespace ash {
+class StatusAreaWidget;
+
+class ASH_EXPORT ImeMenuTray : public TrayBackgroundView,
+ public IMEObserver,
+ public wm::WindowStateObserver {
+ public:
+ explicit ImeMenuTray(StatusAreaWidget* status_area_widget);
+ ~ImeMenuTray() override;
+
+ // Sets the window state of the IME menu AppWindow.
+ void SetWindowState(wm::WindowState* window_state);
sky 2016/06/30 16:21:39 WindowState is owned by the corresponding window.
Azure Wei 2016/06/30 17:45:01 Changed the method SetWindowState(wm::WindowState*
+
+ // 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;
+
+ // wm::WindowStateObserver:
+ void OnPostWindowStateTypeChange(wm::WindowState* window_state,
+ wm::WindowStateType old_type) override;
+
+ private:
+ // To allow the test class to access GetLabelTextForTest() method.
+ friend class ImeMenuTrayTest;
+
+ // Updates the UI of the IME menu tray.
+ void UpdateTray();
+
+ // Sets the border of the label to keep the tray width consistant.
+ void SetLabelBorder();
+
+ views::Label* label_;
+ ash::wm::WindowState* window_state_;
+ ash::IMEInfo current_ime_;
+
+ DISALLOW_COPY_AND_ASSIGN(ImeMenuTray);
+};
+
+} // namespace ash
+
+#endif // ASH_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_
« no previous file with comments | « ash/shelf/shelf_util.cc ('k') | ash/system/chromeos/ime_menu/ime_menu_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698