Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / athena / wm / overview_toolbar.h
bloba6fdb3b8415e1c59e84d249b7911b1b8d05a550e
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_WM_OVERVIEW_TOOLBAR_H_
6 #define ATHENA_WM_OVERVIEW_TOOLBAR_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/geometry/rect.h"
12 namespace aura {
13 class Window;
16 namespace gfx {
17 class Transform;
20 namespace ui {
21 class GestureEvent;
24 namespace athena {
26 class ActionButton;
28 // Responsible for showing action-buttons at the right edge of the screen during
29 // overview mode.
30 class OverviewToolbar {
31 public:
32 enum ActionType {
33 ACTION_TYPE_NONE,
34 ACTION_TYPE_CLOSE,
35 ACTION_TYPE_SPLIT,
38 explicit OverviewToolbar(aura::Window* container);
39 virtual ~OverviewToolbar();
41 ActionType current_action() const { return current_action_; }
43 // Returns the action the gesture-event is targeting.
44 ActionType GetHighlightAction(const ui::GestureEvent& event) const;
46 void SetHighlightAction(ActionType action);
47 void ShowActionButtons();
48 void HideActionButtons();
50 private:
51 void ToggleActionButtonsVisibility();
52 bool IsEventOverButton(ActionButton* button,
53 const ui::GestureEvent& event) const;
54 gfx::Transform ComputeTransformFor(ActionButton* button) const;
55 void TransformButton(ActionButton* button);
57 bool shown_;
58 scoped_ptr<ActionButton> close_;
59 scoped_ptr<ActionButton> split_;
60 ActionType current_action_;
61 const gfx::Rect container_bounds_;
63 DISALLOW_COPY_AND_ASSIGN(OverviewToolbar);
66 } // namespace athena
68 #endif // ATHENA_WM_OVERVIEW_TOOLBAR_H_