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

Unified Diff: ash/wm/maximize_bubble_controller.h

Issue 10823025: Adding new maximize menu according to spec (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: git try Created 8 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 | « ash/wm/frame_painter.cc ('k') | ash/wm/maximize_bubble_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/maximize_bubble_controller.h
diff --git a/ash/wm/maximize_bubble_controller.h b/ash/wm/maximize_bubble_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..5712a3c161b8d1b6742de8c21fb885a1322a648a
--- /dev/null
+++ b/ash/wm/maximize_bubble_controller.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2012 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_WM_MAXIMIZE_BUBBLE_CONTROLLER_H_
+#define ASH_WM_MAXIMIZE_BUBBLE_CONTROLLER_H_
+
+#include "ash/ash_export.h"
+#include "ash/wm/workspace/snap_types.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class Timer;
+}
+
+namespace aura {
+class Window;
+}
+
+namespace ash {
+
+class FrameMaximizeButton;
+
+// A class which shows a helper UI for the maximize button after a delay.
+class ASH_EXPORT MaximizeBubbleController {
+ public:
+ class Bubble;
+
+ MaximizeBubbleController(FrameMaximizeButton* frame_maximize_button,
+ bool is_maximized);
+ // Called from the outside to destroy the interface to the UI visuals.
+ // The visuals will then delete when possible (maybe asynchronously).
+ virtual ~MaximizeBubbleController();
+
+ // Update the UI visuals to reflect the previewed |snap_type| snapping state.
+ void SetSnapType(SnapType snap_type);
+
+ // To achieve proper Z-sorting with the snap animation, this window will be
+ // presented above the phantom window.
+ aura::Window* GetBubbleWindow();
+
+ // Reset the delay of the menu creation (if it was not created yet).
+ void DelayCreation();
+
+ // Called to tell the owning FrameMaximizeButton that a button was clicked.
+ void OnButtonClicked(SnapType snap_type);
+
+ // Called to tell the the owning FrameMaximizeButton that the hover status
+ // for a button has changed. |snap_type| can be either SNAP_LEFT, SNAP_RIGHT,
+ // SNAP_MINIMIZE or SNAP_NONE.
+ void OnButtonHover(SnapType snap_type);
+
+ // Get the owning FrameMaximizeButton.
+ FrameMaximizeButton* frame_maximize_button() {
+ return frame_maximize_button_;
+ }
+
+ // The status of the associated window: Maximized or normal.
+ bool is_maximized() const { return is_maximized_; }
+
+ protected:
+ // Called from the the Bubble class to destroy itself: It tells the owning
+ // object that it will destroy itself asynchronously. The owner will then
+ // destroy |this|.
+ void RequestDestructionThroughOwner();
+
+ private:
+ // The function which creates the bubble once the delay is elapsed.
+ void CreateBubble();
+
+ // The owning button which is also the anchor for the menu.
+ FrameMaximizeButton* frame_maximize_button_;
+
+ // The bubble menu.
+ Bubble* bubble_;
+
+ // If true the owning window is maximized.
+ const bool is_maximized_;
+
+ // The timer for the delayed creation of the menu.
+ scoped_ptr<base::Timer> timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(MaximizeBubbleController);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_MAXIMIZE_BUBBLE_CONTROLLER_H_
« no previous file with comments | « ash/wm/frame_painter.cc ('k') | ash/wm/maximize_bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698