Disable some more flaky AppWindowInterceptAllKeysTest.* on Windows
[chromium-blink-merge.git] / athena / home / home_card_impl.h
blob08e56c5919c6da44e64d1ff950a56cfde8c62d37
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ATHENA_HOME_HOME_CARD_IMPL_H_
6 #define ATHENA_HOME_HOME_CARD_IMPL_H_
8 #include "athena/athena_export.h"
9 #include "athena/home/home_card_gesture_manager.h"
10 #include "athena/home/public/home_card.h"
11 #include "athena/home/public/search_controller_factory.h"
12 #include "athena/input/public/accelerator_manager.h"
13 #include "athena/wm/public/window_manager_observer.h"
14 #include "base/gtest_prod_util.h"
15 #include "ui/app_list/app_list_model_observer.h"
17 namespace app_list {
18 class AppListViewDelegate;
21 namespace aura {
22 class Window;
25 namespace gfx {
26 class Rect;
29 namespace ui {
30 class LayerOwner;
33 namespace views {
34 class Widget;
37 namespace athena {
38 class AppModelBuilder;
39 class HomeCardLayoutManager;
40 class HomeCardView;
42 class ATHENA_EXPORT HomeCardImpl : public HomeCard,
43 public AcceleratorHandler,
44 public HomeCardGestureManager::Delegate,
45 public WindowManagerObserver,
46 public app_list::AppListModelObserver {
47 public:
48 HomeCardImpl(scoped_ptr<AppModelBuilder> model_builder,
49 scoped_ptr<SearchControllerFactory> search_factory);
50 ~HomeCardImpl() override;
52 void Init();
54 aura::Window* GetHomeCardWindowForTest() const;
56 private:
57 FRIEND_TEST_ALL_PREFIXES(HomeCardTest, AppListStates);
59 enum Command {
60 COMMAND_SHOW_HOME_CARD,
62 void InstallAccelerators();
64 void ResetQuery();
66 // Overridden from HomeCard:
67 void SetState(HomeCard::State state) override;
68 State GetState() override;
69 void UpdateVirtualKeyboardBounds(const gfx::Rect& bounds) override;
71 // AcceleratorHandler:
72 bool IsCommandEnabled(int command_id) const override;
73 bool OnAcceleratorFired(int command_id,
74 const ui::Accelerator& accelerator) override;
76 // HomeCardGestureManager::Delegate:
77 void OnGestureEnded(HomeCard::State final_state, bool is_fling) override;
78 void OnGestureProgressed(HomeCard::State from_state,
79 HomeCard::State to_state,
80 float progress) override;
82 // WindowManagerObserver:
83 void OnOverviewModeEnter() override;
84 void OnOverviewModeExit() override;
85 void OnSplitViewModeEnter() override;
86 void OnSplitViewModeExit() override;
88 // app_list::AppListModelObserver:
89 void OnAppListModelStateChanged(
90 app_list::AppListModel::State old_state,
91 app_list::AppListModel::State new_state) override;
93 scoped_ptr<AppModelBuilder> model_builder_;
94 scoped_ptr<SearchControllerFactory> search_factory_;
96 HomeCard::State state_;
98 // original_state_ is the state which the home card should go back to after
99 // the virtual keyboard is hidden.
100 HomeCard::State original_state_;
102 views::Widget* home_card_widget_;
103 HomeCardView* home_card_view_;
104 scoped_ptr<app_list::AppListViewDelegate> view_delegate_;
105 HomeCardLayoutManager* layout_manager_;
107 DISALLOW_COPY_AND_ASSIGN(HomeCardImpl);
110 } // namespace athena
112 #endif // ATHENA_HOME_HOME_CARD_IMPL_H_