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

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: Fix patch failure. Created 4 years, 5 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/ash_chromeos_strings.grdp ('k') | ash/common/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/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..4a0ebffab80edd12bee382457a44ad4750dff98a
--- /dev/null
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.h
@@ -0,0 +1,58 @@
+// 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"
+#include "ash/common/system/tray/tray_background_view.h"
+#include "base/macros.h"
+
+namespace views {
+class Label;
+} // namespace views
+
+namespace ash {
+class StatusAreaWidget;
+class WmWindow;
+
+// The tray item for IME menu.
+class ASH_EXPORT ImeMenuTray : public TrayBackgroundView, public IMEObserver {
+ public:
+ explicit ImeMenuTray(WmShelf* wm_shelf);
+ ~ImeMenuTray() override;
+
+ // 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;
+
+ private:
+ // To allow the test class to access |label_|.
+ friend class ImeMenuTrayTest;
+
+ // Updates the text of the label on the tray.
+ void UpdateTrayLabel();
+
+ // Highlights the button and shows the IME menu tray bubble if |is_active| is
+ // true; otherwise, lowlights the button and hides the menu.
+ void SetTrayActivation(bool is_active);
+
+ views::Label* label_;
+ IMEInfo current_ime_;
+
+ DISALLOW_COPY_AND_ASSIGN(ImeMenuTray);
+};
+
+} // namespace ash
+
+#endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_
« no previous file with comments | « ash/ash_chromeos_strings.grdp ('k') | ash/common/system/chromeos/ime_menu/ime_menu_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698