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

Unified Diff: athena/wm/overview_toolbar.h

Issue 459613008: athena: Allow getting into split-view mode from overview-mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 4 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 | « athena/wm/DEPS ('k') | athena/wm/overview_toolbar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/overview_toolbar.h
diff --git a/athena/wm/overview_toolbar.h b/athena/wm/overview_toolbar.h
new file mode 100644
index 0000000000000000000000000000000000000000..a6fdb3b8415e1c59e84d249b7911b1b8d05a550e
--- /dev/null
+++ b/athena/wm/overview_toolbar.h
@@ -0,0 +1,68 @@
+// Copyright 2014 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 ATHENA_WM_OVERVIEW_TOOLBAR_H_
+#define ATHENA_WM_OVERVIEW_TOOLBAR_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace aura {
+class Window;
+}
+
+namespace gfx {
+class Transform;
+}
+
+namespace ui {
+class GestureEvent;
+}
+
+namespace athena {
+
+class ActionButton;
+
+// Responsible for showing action-buttons at the right edge of the screen during
+// overview mode.
+class OverviewToolbar {
+ public:
+ enum ActionType {
+ ACTION_TYPE_NONE,
+ ACTION_TYPE_CLOSE,
+ ACTION_TYPE_SPLIT,
+ };
+
+ explicit OverviewToolbar(aura::Window* container);
+ virtual ~OverviewToolbar();
+
+ ActionType current_action() const { return current_action_; }
+
+ // Returns the action the gesture-event is targeting.
+ ActionType GetHighlightAction(const ui::GestureEvent& event) const;
+
+ void SetHighlightAction(ActionType action);
+ void ShowActionButtons();
+ void HideActionButtons();
+
+ private:
+ void ToggleActionButtonsVisibility();
+ bool IsEventOverButton(ActionButton* button,
+ const ui::GestureEvent& event) const;
+ gfx::Transform ComputeTransformFor(ActionButton* button) const;
+ void TransformButton(ActionButton* button);
+
+ bool shown_;
+ scoped_ptr<ActionButton> close_;
+ scoped_ptr<ActionButton> split_;
+ ActionType current_action_;
+ const gfx::Rect container_bounds_;
+
+ DISALLOW_COPY_AND_ASSIGN(OverviewToolbar);
+};
+
+} // namespace athena
+
+#endif // ATHENA_WM_OVERVIEW_TOOLBAR_H_
« no previous file with comments | « athena/wm/DEPS ('k') | athena/wm/overview_toolbar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698