| 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..5e9d95e2c3114f506ab159f89023600a2f5e29b9
|
| --- /dev/null
|
| +++ b/ash/system/chromeos/ime_menu/ime_menu_tray.h
|
| @@ -0,0 +1,80 @@
|
| +// 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/tray/system_tray_delegate.h"
|
| +#include "ash/common/wm/window_state_observer.h"
|
| +#include "ash/system/ime/ime_observer.h"
|
| +#include "ash/system/tray/tray_background_view.h"
|
| +#include "base/macros.h"
|
| +#include "ui/aura/window_observer.h"
|
| +
|
| +namespace aura {
|
| +class Window;
|
| +}
|
| +
|
| +namespace views {
|
| +class Label;
|
| +}
|
| +
|
| +namespace ash {
|
| +class ImeMenuLabel;
|
| +class StatusAreaWidget;
|
| +
|
| +class ASH_EXPORT ImeMenuTray : public TrayBackgroundView,
|
| + public IMEObserver,
|
| + public wm::WindowStateObserver,
|
| + public aura::WindowObserver {
|
| + public:
|
| + explicit ImeMenuTray(StatusAreaWidget* status_area_widget);
|
| + ~ImeMenuTray() override;
|
| +
|
| + // Sets the window state of the IME menu AppWindow.
|
| + void SetWindowState(wm::WindowState* window_state);
|
| +
|
| + // 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;
|
| +
|
| + // aura::WindowObserver:
|
| + void OnWindowDestroying(aura::Window* window) override;
|
| +
|
| + private:
|
| + // To allow the test class to access GetLabelTextForTest() method.
|
| + friend class ImeMenuTrayTest;
|
| +
|
| + // Returns the aura window of the setting |window_state_|.
|
| + aura::Window* GetAuraWindow();
|
| + // Updates the UI of the IME menu tray.
|
| + void UpdateTray();
|
| + // Sets the border of the label to keep the tray width consistant.
|
| + void SetLabelBorder();
|
| +
|
| + // Returns the text of the tray label.
|
| + base::string16 GetLabelTextForTesting();
|
| +
|
| + ImeMenuLabel* 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_
|
|
|