Disable some more flaky AppWindowInterceptAllKeysTest.* on Windows
[chromium-blink-merge.git] / athena / home / home_card_view.h
blob7504d2e23cec5c15292d79a6d72d1e6133cb639a
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_VIEW_H_
6 #define ATHENA_HOME_HOME_CARD_VIEW_H_
8 #include "athena/athena_export.h"
9 #include "athena/home/home_card_gesture_manager.h"
10 #include "base/callback_forward.h"
11 #include "base/gtest_prod_util.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h"
14 #include "ui/gfx/animation/tween.h"
15 #include "ui/views/widget/widget_delegate.h"
17 namespace app_list {
18 class AppListMainView;
19 class AppListViewDelegate;
20 class SearchBoxView;
23 namespace aura {
24 class Window;
27 namespace views {
28 class View;
31 namespace athena {
33 // The container view of home card contents.
34 class ATHENA_EXPORT HomeCardView : public views::WidgetDelegateView {
35 public:
36 HomeCardView(app_list::AppListViewDelegate* view_delegate,
37 HomeCardGestureManager::Delegate* gesture_delegate);
38 ~HomeCardView() override;
40 void Init();
42 void SetStateProgress(HomeCard::State from_state,
43 HomeCard::State to_state,
44 float progress);
46 void SetStateWithAnimation(HomeCard::State state,
47 gfx::Tween::Type tween_type,
48 const base::Closure& on_animation_ended);
50 void ClearGesture();
52 // views::View:
53 void OnGestureEvent(ui::GestureEvent* event) override;
54 bool OnMousePressed(const ui::MouseEvent& event) override;
55 void Layout() override;
57 private:
58 FRIEND_TEST_ALL_PREFIXES(HomeCardTest, AppListStates);
60 gfx::Rect GetDragIndicatorBounds(HomeCard::State state);
62 gfx::Rect GetMainViewBounds(HomeCard::State state);
64 void UpdateMinimizedBackgroundVisibility();
66 // views::WidgetDelegate:
67 views::View* GetContentsView() override;
69 views::View* background_;
70 app_list::AppListMainView* main_view_;
71 app_list::SearchBoxView* search_box_view_;
72 views::View* minimized_background_;
73 views::View* drag_indicator_;
74 HomeCard::State state_;
75 scoped_ptr<HomeCardGestureManager> gesture_manager_;
76 HomeCardGestureManager::Delegate* gesture_delegate_;
78 base::WeakPtrFactory<HomeCardView> weak_factory_;
80 DISALLOW_COPY_AND_ASSIGN(HomeCardView);
83 } // namespace athena
85 #endif // ATHENA_HOME_CARD_VIEW_H_